c# get enum value by int code example Example: convert int to enum c# YourEnum foo = (YourEnum)yourInt;