public ActionResult Create(GenreViewModel model) { if (ModelState.IsValid) { var genre = new GameGenre { Name = model.Name }; ProductManager.CreateGenre(genre); ProductManager.Save(); return RedirectToAction("Index"); } return View(model); }
public void UpdateGenre(GameGenre genre) { if (genre != null) { Context.Entry(genre).State = EntityState.Modified; } }
public void CreateGenre(GameGenre genre) { if (genre != null) { Context.GameGenres.Add(genre); } }
public ActionResult Update(GenreViewModel model) { if (ModelState.IsValid) { var category = new GameGenre { Id = model.Id, Name = model.Name }; ProductManager.UpdateGenre(category); ProductManager.Save(); return RedirectToAction("Index"); } return View(model); }