I have an enum which is defined like this:
public enum eRat { A = 0, B=3, C=5, D=8 };
So given value eRat.B, I want to get the
eRat.B
LINQ solution that does not break on last element but continues at the default again:
var nextValue = Enum.GetValues(typeof(EnumT)).Cast().Concat(new[]{default(EnumT)}).SkipWhile(_ => _ != value).Skip(1).First();