public ActionResult Create(Genre genre) { if (ModelState.IsValid) { genre.Date_Creation = DateTime.Now; context.Genres.Add(genre); context.SaveChanges(); return RedirectToAction("Index"); } return View(genre); }
public ActionResult Edit(Genre genre) { if (ModelState.IsValid) { context.Entry(genre).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } return View(genre); }