//[ValidateAntiForgeryToken] public ActionResult DeleteConfirmed(int id) { Producer producer = _producerRepository.GetProducerById(id); _producerRepository.DeleteProducer(producer.Id); _producerRepository.Save(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { try { _ProducerRep.DeleteProducer(id); _ProducerRep.save(); return(RedirectToAction("Index")); } catch (DataException) { return(RedirectToAction("Delete", new System.Web.Routing.RouteValueDictionary { { "id", id }, { "saveChangesError", true } })); } }
public void Delete(int producerId) { _producerRepository.DeleteProducer(producerId); }