Enums are a data type in .NET Framework that can be used to hold enumerated values. You primarily use enums to restrict the possible values that can be assigned to a variable or returned from a method.
This chapter shines a light on this data type.
You use the Enum keyword to create a set of valid values for a field or a method. For example, the only possible values for the CustomerType field may be Individual and Organization. For the State field, valid values may be all the states in the US plus Canadian provinces. With Enum, you can easily restrict your program to take only one of the valid values.
An enum type can stand alone or be part of a class. You make it stand alone if it needs to be ...