diff --git a/src/libs/FastEnum.Core/Internals/EnumInfo.cs b/src/libs/FastEnum.Core/Internals/EnumInfo.cs index 7bdef47..01fe344 100644 --- a/src/libs/FastEnum.Core/Internals/EnumInfo.cs +++ b/src/libs/FastEnum.Core/Internals/EnumInfo.cs @@ -47,7 +47,10 @@ static EnumInfo() .DistinctBy(static x => x.Value) .ToArray(); s_memberByNameCaseSensitive = s_members.ToCaseSensitiveStringDictionary(static x => x.Name); - s_memberByNameCaseInsensitive = s_members.ToCaseInsensitiveStringDictionary(static x => x.Name); + s_memberByNameCaseInsensitive + = s_members + .DistinctBy(static x => x.Name, StringComparer.OrdinalIgnoreCase) + .ToCaseInsensitiveStringDictionary(static x => x.Name); s_memberByValue = s_orderedMembers.ToFastReadOnlyDictionary(static x => x.Value); s_minValue = s_values.DefaultIfEmpty().Min(); s_maxValue = s_values.DefaultIfEmpty().Max();