I\'m using MVC 5.2.0 and I\'m trying to use the new Html.EnumDropDownListFor. This is how I\'m setting the values:
Html.EnumDropDownListFor
//Model public class MyModel
Just Use This in Your Controller, It works like a charm
MyModel.TestEnum = (TestEnum)SelectedEnumId;
Not This will work fine assuming the case, that SelectedEnumId > 0.
if(SelectedEnumId > 0) { MyModel.TestEnum = (TestEnum)SelectedEnumId; }