how to convert int to enum in c# code example Example: convert int to enum c# YourEnum foo = (YourEnum)yourInt;