Can we get a generic Parse method on Enum in the next version of .NET?

I have one tiny pet peeve about Enum.Parse. It's so  verbose with the typeing (both meanings of the word).

Here's what you have to do today:

   1:  public enum MyEnum
   2:  {
   3:    One,
   4:    Two
   5:  }
   7:  MyEnum me = (MyEnum)Enum.Parse(typeof(MyEnum), "One");

what I'd like to see is an overload of Parse that supported a generic param like this:

   1:  MyEnum me = Enum.Parse<MyEnum>("One");

1 Comment

Comments have been disabled for this content.