enum default type code example
Example 1: c# size of enum
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
Example 2: C# enum
enum CellphoneBrand {
Samsung,
Apple,
LG,
Nokia,
Huawei,
Motorola
}
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
enum CellphoneBrand {
Samsung,
Apple,
LG,
Nokia,
Huawei,
Motorola
}