I am using @Html.EditorForModel() in several places, and I'm just wondering if there is a simple attribute to indicate that something should be a drop-down list in the view model? An example of what I'm looking for would be ...
public class MyViewModel { [DropDown("red", "blue", "green")] public string Lasers { get; set; } }
I know that similar questions have been asked, and I know that I can create my own template that will implement something like this ... I was wondering if this seemingly simple functionality exists, or if there is any NuGet package that added this functionality. It just seems too simple not to exist somewhere, and I may have to make the NuGet package myself, if not already.
Thanks in advance to everyone!
source share