示例#1
0
        public async Task <bool> CreateFood(FoodCreateDTO dto)
        {
            var rao = _mapper.Map <FoodCreateRAO>(dto);

            if (await _repository.CreateFood(rao))
            {
                return(true);
            }


            throw new NotImplementedException();
        }
示例#2
0
        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);
        }
示例#3
0
 public async Task <CreateFoodResult> CreateFood(CreateFoodRequest request)
 {
     return(await orderRepository.CreateFood(request));
 }