Set:The set { } implementation receives the implicit argument 'value', which is the value to which the property is assigned.
what it mean ??
Loading
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 Jul 24, 2013, 3:19 AM
private int myInt;
public int MyInt
{
get { return myInt; }
set { myInt = value; }
}
Then the C# compiler changes it into this pair of methods:
public int get_MyInt()
{
return myInt;
}
public void set_MyInt(int value)
{
myInt = value;
}
So, it will be seen that the implicit variable 'value' is just the argument to the underlying method which is used to set the value of the property's 'backing' field.