I have an object with a property for which I want to create a custom setter and also keep the automatic getter:
public class SomeObject
{
public int SomeProp { get; set; }
public Nullable<short> MyProp
{
get
{
return MyProp;
}
set
{
if (value != null)
{
SomeProp = SomeWork(value);
MyProp = value;
}
}
}
}
The problem is that I get a Stackoverflow error on the getter. How do I implement a property where I keep the getter as it is but only modify the setter?