public ActionResult Edit(Board board) { if (ModelState.IsValid) { db.Entry(board).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(board); }
public ActionResult Create(Board board) { if (ModelState.IsValid) { db.Boards.Add(board); db.SaveChanges(); return RedirectToAction("Index"); } return View(board); }