Yes it is possible. It is called asymmetric accessibility, and you can read the MSDN documentation for it on this page . The code will look something like this:
public int Age
{
get
{
return _age;
}
protected set
{
_age = value;
}
}
However, there are a few important caveats:
- Only one accessor can be changed.
- , , , , .
- .