Why is it I get an error in the below code saying auto implemented property must be fully assigned before control is returned to the caller
but when I change the keyword from struct to class, the error goes away?
C#:
public struct Customer
{
private int id;
private string name;
public Customer(int a, string b)
{
this.id = a;
this.name = b;
}
public int ColorIndex { get; set; }
public string ColorName { get; set; }
}
but when I change the keyword from struct to class, the error goes away?