Initial Value of an Enum

前端 未结 10 566
陌清茗
陌清茗 2020-12-08 01:51

I have a class with a property which is an enum

The enum is

/// 
/// All available delivery actions
/// 
public enum E         


        
10条回答
  •  死守一世寂寞
    2020-12-08 02:26

    You can start your enums at any value (such as 1), but when they represent a lookup value in a Database, you generally want them to match up.

    I generally declare the first Enum as None ( = 0) when it makes sense to do so, as per the .Net Framework Design guidelines.

提交回复
热议问题