You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I would like to create a SmartEnum<TestEnum, string> where the value is string but I would like for the comparison of values to be case insensitive.
So for example if I have:
Currency.TryFromValue("usd",outvar_)//returns false, would like it to return true
Basically I would like for the TryFromValue to be case insensitive or more generally be able to specify a IComparer.
Any suggestion or idea on how to do this?
The text was updated successfully, but these errors were encountered:
@ardalis if I have a PR for this do you think it has a chance to get merged.
My solution for this would be implementing support for a Equality comparer attribute that you would use like this:
* Implemented SmartEnumComparerAttribute<T> with tests
* Aligned to other files formatting
* Updated method names
* Added usage example
---------
Co-authored-by: Steve Smith <steve@kentsmiths.com>
Hi,
I would like to create a SmartEnum<TestEnum, string> where the value is string but I would like for the comparison of values to be case insensitive.
So for example if I have:
If I do:
Basically I would like for the TryFromValue to be case insensitive or more generally be able to specify a IComparer.
Any suggestion or idea on how to do this?
The text was updated successfully, but these errors were encountered: