I have the following code in my class:
private int order;
public int Order {
get { return order; }
set { order = value; }
}
}
I tested it out by trying the following and it works okay. Can someone tell me is this a legal thing for me to do? In the past I have always used the following:
public int Order { get; set; }
Is there any difference between this and doing it manually other than the manual way requires more typing?
Very little difference and in my opinion, not required unless you need to do some manipulation of the private member on the get or set.