Skip to content

Instantly share code, notes, and snippets.

@ellenia
Created December 19, 2016 18:47
Show Gist options
  • Save ellenia/b60b265e60b4f89ed2ef874091e4c061 to your computer and use it in GitHub Desktop.
Save ellenia/b60b265e60b4f89ed2ef874091e4c061 to your computer and use it in GitHub Desktop.
namespace EnumCasting
{
enum Status
{
Unknown = 0,
Active = 1,
Inactive = 2
}
class Program
{
static void Main(string[] args)
{
Status statusUnknown = Status.Unknown;
Status statusActive = Status.Active;
Console.WriteLine("{0}:{1}", statusUnknown, (int)statusUnknown);
Console.WriteLine("{0}:{1}", statusActive, (int)statusActive);
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment