wasSharp
/Reflection.cs |
@@ -117,7 +117,8 @@ |
/// <param name="name">the description of a member</param> |
/// <param name="comparison">the string comparison to use</param> |
/// <returns>the value or the default of T if case no name attribute found</returns> |
public static T GetEnumValueFromName<T>(string name, StringComparison comparison = StringComparison.OrdinalIgnoreCase) |
public static T GetEnumValueFromName<T>(string name, |
StringComparison comparison = StringComparison.OrdinalIgnoreCase) |
{ |
var field = typeof(T).GetRuntimeFields().ToArray() |
.AsParallel().SelectMany(f => f.GetCustomAttributes( |