Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Display/Description attribute data in a new column #33

Open
sveinhelge opened this issue Jul 25, 2015 · 4 comments
Open

Include Display/Description attribute data in a new column #33

sveinhelge opened this issue Jul 25, 2015 · 4 comments

Comments

@sveinhelge
Copy link

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.

@timabell timabell added this to the v2 milestone Jul 27, 2015
@timabell
Copy link
Owner

+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.

@jasonp123
Copy link

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

@timabell
Copy link
Owner

Great minds think alike @jasonp123 - take a look at the linked pull request discussion

@jasonp123
Copy link

ha.. I'm new.. ignore me :-)

timabell added a commit that referenced this issue Aug 18, 2015
shouldn't affect anything

Original patch by Svein Helge <[email protected]> #mailto:[email protected] PR #33
timabell added a commit that referenced this issue Aug 18, 2015
taken from PR #33
timabell added a commit that referenced this issue Aug 18, 2015
contribution from PR #33 - Svein Helge <[email protected]>

extended the contribution to cover both test classes
@timabell timabell changed the title Description as column Include Display/Description attribute data in a new column Jan 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants