I have a class with a property which is an enum
The enum is
/// <summary>
/// All available delivery actions
/// </summary>
public enum EnumDeliveryAction
{
/// <summary>
/// Tasks with email delivery action will be emailed
/// </summary>
Email,
/// <summary>
/// Tasks with SharePoint delivery action
/// </summary>
SharePoint
}
When I create an instance of this class, NOWHERE in the code, do I specify the value of the enum field, but it seems to default to the first item in the enumlist, and not a null value, is this how enums work? How is it possible to ensure that the enum gets some kind of null value if it is not set, I don't want it defaulting to the first value in the enum.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…