public ActionResult Delete(int id, ArmyBLL ArmyToDelete)
 {
     try
     {
         using (ContextBLL ctx = new ContextBLL())
         {
             ctx.ArmyDelete(id);
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception oops)
     {
         Error.Log(oops);
         return(View("Error", oops));
     }
 }
Exemple #2
0
 public ActionResult Delete(int id, ArmyBLL ArmyToDelete)
 {        // this will not only delete the army but also all models in the many to many table that come with it
     try
     {
         using (ContextBLL ctx = new ContextBLL())
         {
             ctx.ArmyDelete(id);
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception oops)
     {
         Error.Log(oops);
         return(View("Error", oops));
     }
 }