EntityFramework-Reverse-POCO-Code-First-Generator
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard
Is there a way to generate the a description attribute for enums?
We would like to include the description attribute on enums. Is there a way to do that? we arent finding a setting the the tt files for this.
example output
public enum MyEnum
{
Name1 = 1,
[Description("Here is another")]
HereIsAnother = 2,
[Description("Last one")]
LastOne = 3
}
No it doesn't. It would be fairly straight forward to add though
Add a DescriptionField property to EnumerationSettings
Update
protected override string EnumSQL(string table, string nameField, string valueField) to return SQL to also get the DescriptionField.
The ReadEnums function will need to be updated to also store the DescriptionField data. It's currently in a KeyValuePair<string, string> so will need to change to store two values as the value field: (ValueField & DescriptionField)
Modify Enumeration class to match the KeyValuePair type above.
Finally modify the relevant Template Enums() function. to include the Description attribute.
The template is currently:
public enum {{EnumName}}{{#newline}}
{{{#newline}}
{{#each Items}}
{{Key}} = {{Value}},{{#newline}}
{{/each}}
}{{#newline}}