Create a class DropdownList<t> where T is the entity which contain the property for value and text and method like below
public static class DropDownList<T>
{
public static SelectList LoadItems(IList<T> collection, string value, string text)
{
return new SelectList(collection, value, text);
}
}
Call the method like below.First Argument is the IEnumerable collection of records that you need to populate in the dropdown and remaining arguments are the value field and text field.
ViewData["LoadCities"] = DropDownList<City>.LoadItems(_requestRepository.GetCities(),"Id","City");
Call from the view like below
@Html.DropDownListFor(model => model.Id, (IEnumerable<selectlistitem>)ViewData["LoadCities"], "--Select--", new { @class = "select" })
You can reuse the DropDownList to pulate the dropdown list.Hope this helps