public void DeleteFood(FoodDTO dto) { try { log.Debug(FoodDTO.FormatFoodDTO(dto)); R_Food t = FoodDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteFood(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public IActionResult DeleteConfirmed(int id) { try { _foodRepository.DeleteFood(id); } catch (DbUpdateException /* ex */) { //Log the error (uncomment ex variable name and write a log. ModelState.AddModelError("", "Delete failed. Try again, and if the problem persists " + "see your system administrator."); } return(RedirectToAction("Index")); }
public void DeleteFood(int?idFood) { foodRepository.DeleteFood(idFood); }
public async Task DeleteFood(int id) { await _foodRepository.DeleteFood(id); }
public async Task <DeleteFoodResult> DeleteFood(DeleteFoodRequest request) { return(await orderRepository.DeleteFood(request)); }
public async Task <bool> DeleteFood(int id) { await _repository.DeleteFood(id); return(true); }