public async Task <bool> CreateFood(FoodCreateDTO dto) { var rao = _mapper.Map <FoodCreateRAO>(dto); if (await _repository.CreateFood(rao)) { return(true); } throw new NotImplementedException(); }
public CreateFoodResponse CreateFood(FoodDto foodDto) { CreateFoodResponse response = new CreateFoodResponse(); try { _foodRepository.CreateFood(foodDto); response.ResponseStatus.SetOk(); } catch (Exception e) { _logger.LogError(e.ToString()); response.ResponseStatus.SetError(ResponseStatusCode.INTERNAL_SERVER_ERROR, e.ToString()); } return(response); }
public async Task <CreateFoodResult> CreateFood(CreateFoodRequest request) { return(await orderRepository.CreateFood(request)); }