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