optpter == can't with int on emnum c# code example Example: convert int to enum c# YourEnum foo = (YourEnum)yourInt;