예제 #1
0
 public ActionResult Delete(int id, Status status)
 {
     try
     {
         _db.Entry(status).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(Status newStatus)
 {
     try
     {
         _db.Statuses.Add(newStatus);
         _db.SaveChanges();
         return RedirectToAction("Index");
     }
     catch
     {
         // TODO Add error display logic here eventually.
         return View();
     }
 }