get max value enum c# code example Example: get max enum value c# var lastFoo = Enum.GetValues(typeof(Foo)).Cast<Foo>().Max();