How do i create an enum with a null value
ex:
public enum MyEnum
{
[StringValue("X")]
MyX,
[StringValue("Y")]
MyY,
None
}
where None value is null or String.Empty
You can try something like this:-
public MyEnum? value= null;
or you can try this:-
public MyEnum value= MyEnum.None;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With