I\'ve run into a really interesting runtime bug which generates a rogue stack overflow.
I\'ve defined a structure as follows:
public enum EnumDataTy
stack overflow happens because in the setter you are setting the property to a value (Ie you are trying to get something to set itself to something ... which causes an infinite loop) ... which means that it tries to set itself to a value which means its tries to set itself to a value untill boom
your properties will never get the values you are setting because they always return the same value (not the stored value)
public enum EnumDataType { Raspberry, Orange, Pear, Apple };
public class DataRequest
{
private long _dataSize = 0;
private EnumDataType _dataType = EnumDataType.Apple;
public long DataSize { get { return _dataSize ; } set { _dataSixe= value; } }
public EnumDataType DataType { get { return _dataType; } set { _dataType= value; } }
}
is what you really wanted