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