Genbox / FastEnum

A source generator to generate common methods for your enum types at compile-time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docs: Document which attributes are used for what

LordMike opened this issue · comments

  • I hereby verify that I am a sponsor.

Sponsorship is required before you can submit feature requests. See https://github.com/sponsors/Genbox

Describe the feature
Please document which attributes are used. I know I can use DisplayAttribute, and that using this will get me extensions and so on to go to/from display names. But what other attributes are used?

DisplayAttribute is also used in ASP.Net MVC to tweak rendering, so abusing that to store some short names is not feasible. But I don't know what I can use instead.

If I try and use DispayAttribute I get the following error:

Attribute 'System.ComponentModel.DisplayNameAttribute' is not valid on this declaration type. It is valid on 'Class, Method, Property, Event' declarations only.

Seems one can add the DescriptionAttribute on Enums, but this does not seem to generate anything.

@Simonl9l Your error indicates you are using DisplayNameAttribute, not DisplayAttribute.