예제 #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();
     }
 }
예제 #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();
     }
 }