SelectListItem MVC 5 code example
Example 1: generate a dropdown list from array data using razor .net mvc
@Html.DropDownList("myList", ViewBag.myList as SelectList)
Example 2: razor dropdownlistfor
@using MyMVCApp.Models
@model Student
@Html.DropDownListFor(m => m.StudentGender,
new SelectList(Enum.GetValues(typeof(Gender))),
"Select Gender")