public ActionResult Create(Trick trick) { if (ModelState.IsValid) { _db.Tricks.Add(trick); _db.SaveChanges(); return RedirectToAction("Index"); } return View(trick); }
public ActionResult Edit(Trick trick) { if (ModelState.IsValid) { _db.Entry(trick).State = EntityState.Modified; _db.SaveChanges(); return RedirectToAction("Index"); } return View(trick); }