how to get number of elements in enum c# code example
Example 1: count number of enum values C#
int count = Enum.GetValues(typeof(EnumType)).Length;
Example 2: c# size of enum
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
int count = Enum.GetValues(typeof(EnumType)).Length;
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;