public void DeletePlatesAndRestaurant(int id) { var restaurantModel = _restaurantRepository.GetPlateByRestaurant(id); foreach (var plate in restaurantModel.Plates) { _plateRepository.Delete(plate.Id); } _restaurantRepository.Delete(id); }
public void Delete(int id) { _plateRepository.Delete(_plateRepository.GetById(id)); }
public ActionResult DeleteConfirm(int id) { _plateRepository.Delete(id); _unitOfWork.DeletePlate(id); return(RedirectToAction("Index")); }