Пример #1
0
        public async Task <FoodResponseObject> FindOneByNameAsync(string name)
        {
            var found = await _foodRepository.FindOneByNameAsync(name);

            if (found == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound, $"Food with name {name} was not found");
            }

            return(FoodResponseObject.FromEntity(found));
        }