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