get length of enum code example
Example 1: c# size of enum
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
Example 2: get length of enum values
int count = Enum.GetValues(typeof(SystemTypeEnum)).Length;
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
int count = Enum.GetValues(typeof(SystemTypeEnum)).Length;