I’d like to use an attribute for parsing strings to enum values (something like in this question), but I’d like to use multiple strings for each enum value, e.g.:
enum Foo
{
[SomeAttribute("A BAR")]
[SomeAttribute("The BAR")]
Bar,
[SomeAttribute("A BUZZ")]
[SomeAttribute("The BUZZ")]
Buzz
}
That means that I cannot use Description
nor DisplayName
because they have AllowMultiple=false
.
I know that it is simple to create my own attribute, but:
Does the .NET framework already contain a suitable attribute that I can use for this?