We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7dd77f commit 9d20d30Copy full SHA for 9d20d30
src/Datory/EnumExtensions.cs
@@ -24,6 +24,6 @@ private static TAttribute GetEnumMemberAttribute<TAttribute>(this Enum value) wh
24
25
private static TAttribute GetEnumMemberAttribute<TAttribute>(this Type enumType, string enumMemberName)
26
where TAttribute : Attribute =>
27
- enumType.GetMember(enumMemberName).Single().GetCustomAttribute<TAttribute>();
+ enumType.GetMember(enumMemberName).FirstOrDefault().GetCustomAttribute<TAttribute>();
28
}
29
0 commit comments