Example #1
0
        public async Task <IActionResult> AddRestaurant([FromBody] RestaurantDTO newRestaurant)
        {
            Task validateThenAdd()
            {
                _payloadValidator.ValidateData(newRestaurant);
                return(_restaurantRepository.AddRestaruantAsync(newRestaurant));
            }

            return(await toHttpResponse(() => validateThenAdd(), _logger));
        }