I'm looking to get the min and max value of an enum not the max amount of enumerators. I've seen Getting the max value of an enum
However, in Framework 4, cast() doesn't exist for GetValues().
Example:
public enum Foo
{
Bird = 1,
Cat = 2,
Dog = 4,
Hampster = 8
}
var last = Enum.GetValues(typeof(Foo)).Cast<int>().Max();
Result should be: 8
Anyone know how this is done in framework 4 without having to enumerate through it all myself?