Cast Int to Generic Enum in C# December 26, 2022 by Tarik The simplest way I have found is to force the compiler’s hand by adding a cast to object. return (T)(object)i.Value;