[Proposal] Add Enum.IsDefined() method #18063
Labels
api-needs-work
API needs work before it is approved, it is NOT ready for implementation
area-System.Runtime
Milestone
So rather than doing this:
You can do this:
Enum.IsDefined(typeof(MyEnum), argument)
is also quite slow as it needs to do lots of conversion checks etc; whereas if you already have the enum these don't need to be done.e.g.
https://github.com/dotnet/corefx/blob/master/src/System.Private.Uri/src/System/UriExt.cs#L19-L24
Suggested change dotnet/coreclr#6687
/cc @terrajobst
The text was updated successfully, but these errors were encountered: