Yes, you do not have a support field ... so you should do this:
private MyEnumType data; public MyEnumType Data { get { return data; } set { data = value; } }
What happens is that you refer to the property to return itself, it causes an infinite loop of attempts to access its own value. Therefore, StackOverFlow.
In your case, when you do not add additional logic to the get and set methods, you can also use the auto property. It is simply defined like this:
public MyEnumType Data { get; set; }
Robban
source share