Use the "?" notation to make a non-nullable type nullable
public enum Types : int
{
Good = 1,
Medium = 2,
Critical = 3,
}
public class MyData
{
public Types? Types { get; set; }
}
Usage
var myData = new MyData();
myData.Types = null;
System.Diagnostics.Debug.WriteLine(myData.Types);
bool hasTypes = myData.Types.HasValue;
hasTypes = myData.Types != null;
myData.Types = Types.Critical;
System.Diagnostics.Debug.WriteLine(myData.Types);
if this works for you might depend on how you are deserialising your data and what that data looks like.