ardalis / SmartEnum

A base class for quickly and easily creating strongly typed enum replacements in C#.
MIT License
2.17k stars 170 forks source link

Fix case insensitive name comparison bug #532

Open FDUdannychen opened 2 months ago

FDUdannychen commented 2 months ago

SmartFlagEnum doesn't use a proper IStringComparer in TryGetFlagEnumValuesByName implementation, hence bugs when using FromName/TryFromName with ignoreCase=true.

ardalis commented 2 months ago

Thanks for the PR - can you describe the error and also make the update in such a way that it doesn't cause breaking changes (for instance make your boolean flag an optional parameter)?