Open BachiMjavanadze opened 9 months ago
Tagging subscribers to this area: @dotnet/area-system-componentmodel-dataannotations See info in area-owners.md if you want to be subscribed.
Author: | BachiMjavanadze |
---|---|
Assignees: | - |
Labels: | `area-System.ComponentModel.DataAnnotations`, `untriaged` |
Milestone: | - |
The attributes work on arbitrary values, not just strings. A general-purpose API would necessitate passing an IEqualityComparer
parameter, however that typically doesn't work with attribute annotations -- you would need to manually define one via inheritance.
Ok!
I think it would be better if the
[AllowedValues]
and[Denied Values]
attributes had support for case insensitivity. So instead:[AllowedValues("bad", "Bad", "bAd", "baD", "BAD")]
or defining custom attribute, possible to write this:
[AllowedValues("bad" CaseInsensitive = true)]