automatic property
Why it is called automatic property.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 3, 2012, 10:25 AM
public int MyProp { get; set; }
into this:
private int _myInt; // in practice this will be something very obscure
public int MyProp
{
get { return _myInt; }
set { _myInt = value; }
}
The private field is not directly accessible (except by using reflection) and so you always need to access it via the automatic property.
Posted Sep 3, 2012, 11:09 AM