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