public ActionResult Delete(int id, User user) { try { _db.Entry(user).State = System.Data.EntityState.Deleted; _db.SaveChanges(); return RedirectToAction("Index"); } catch { // TODO Add error display logic here eventually. return View(); } }
public ActionResult Create(User newUser) { try { _db.Users.Add(newUser); _db.SaveChanges(); return RedirectToAction("Index"); } catch { // TODO Add error display logic here eventually. return View(); } }