public ActionResult Edit(Board board) { if (ModelState.IsValid) { db.Entry(board).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(board)); }
public ActionResult Edit(Pin pin) { if (ModelState.IsValid) { db.Entry(pin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TypeId = new SelectList(db.Types, "TypeId", "Name", pin.TypeId); ViewBag.BoardId = new SelectList(db.Boards.Where(u => u.User.UserId == WebSecurity.CurrentUserId), "BoardId", "Title", pin.Board.BoardId); return(View(pin)); }