public EditTapViewModel(IEnumerable <KegModel> kegs, string kegId) { if (null == kegs) { throw new ArgumentNullException("kegs"); } Kegs = kegs.Select(k => new SelectListItem() { Text = k.BeerName, Value = k.Id, Selected = (k.Id == kegId) }).ToList(); Kegs.Insert(0, new SelectListItem() { Text = Resources.Admin_Tap_Edit_Dropdownlist, Value = "" }); }
public CreateTapViewModel(IEnumerable <KegModel> kegs) { if (null == kegs) { throw new ArgumentNullException("kegs"); } Kegs = kegs.Select(k => new SelectListItem() { Text = k.BeerName, Value = k.Id }).ToList(); Kegs.Insert(0, new SelectListItem() { Text = Resources.Admin_Tap_Create_Dropdownlist, Value = "", Selected = true }); }