public ActionResult Makes() { IMakeRepository repo = RepoFactory.CreateMakeRepo(); AdminMakeViewModel model = new AdminMakeViewModel(); model.Makes = repo.GetAll().ToList(); return(View(model)); }
public ActionResult Makes(string MakeInput) { IMakeRepository repo = RepoFactory.CreateMakeRepo(); if (MakeInput != null) { var make = new Make() { DateAdded = DateTime.Today, Name = MakeInput, UserId = System.Web.HttpContext.Current.User.Identity.GetUserId() }; repo.Create(make); } AdminMakeViewModel model = new AdminMakeViewModel(); model.Makes = repo.GetAll().ToList(); return(View(model)); }