public ActionResult Create() { var model = new LunchEventViewModel { UserSelectList = new SelectList(db.GetAllUsers().ToList(), "Id", "Name").Prepend(new SelectListItem { Value = "-1", Text = "Select a host", } ), LunchSelectList = new SelectList(db.GetAllLunches().ToList(), "Id", "Name"), }; model.UserSelectList.Append(new SelectListItem { Value = "-1", Text = "Select a host", } ); return(View(model)); }
public ActionResult Index() { var model = db.GetAllUsers(); return(View(model)); }