I'm working in an ASP.NET MVC application. The database I'm working with is a legacy database.
In my code, I have an Enum that looks like this:
public enum Fruit
{
Apple = -1,
None = 0,
Orange = 1
}
I cannot change that, and when I try to do this in my Razor View:
@Html.EnumDropDownListFor(m => m.Fruit, "Select a fruit", new { @class = "form-control" })
The view loads with None always selected, when I want it to load on Select a fruit
What is the cleanest way of achieving this? I can hack it in JavaScript, but is there a better way?