Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 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();
     }
 }