Пример #1
0
 public ActionResult RemoveEquipmentOnCarton([Bind(Include = "CartonId,EquipmentId")] RemoveEquipmentViewModel removeEquipmentViewModel)
 {
     if (ModelState.IsValid)
     {
         // DM: I typically either inject or wrap my contexts directly in a using statement where I need them, so I'll do it here for an example.
         // I realize the db variable is available and should be used and if the team prefered that method that's not a problem for me especially in a web site where the life of a call is well defined
         cartonService.RemoveEquipmentOnCarton(removeEquipmentViewModel);
     }
     return(RedirectToAction("ViewCartonEquipment", new { id = removeEquipmentViewModel.CartonId }));
 }