Open sveinhelge opened 9 years ago
+1 good idea. This would make it possible to add more detail to things that access the db directly.
A pull request for this would be welcome.
I'll hold off actually releasing it till v2 as it's a significant change to the schema and would need some thought in how to handle the transition for existing installations.
I don't think I'd make it configurable, it would just always add it. Allowing the variation increases the complexity of what would have to be supported.
Instead of using [Description("description")] could we use [System.ComponentModel.DataAnnotations.Display(Name="new name", Description="new description")]?
When using the ASP.NET MVC html helper @Html.EnumDropDownListFor(m=>m.MyEnum) it uses the Display("Name="") text to populate the drop down. (https://msdn.microsoft.com/en-us/library/system.web.mvc.html.selectextensions.enumdropdownlistfor(v=vs.118).aspx)
This could also allow the use of a Resource class as well
Great minds think alike @jasonp123 - take a look at the linked pull request discussion
ha.. I'm new.. ignore me :-)
Would like to have the ability to have Description as column.
The table would then look like this: Id Name Description
It could be implemented as a setting. var enumToLookup = new EnumToLookup(); enumToLookup.AddDescriptionColumn = true;
Since [Description("some name")] is used to override name we might need to add new attribute for this or redefine the usage.