enums length code example Example: c# size of enum var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;