Exemplo n.º 1
0
        public async Task <IHttpActionResult> Get(string category)
        {
            try
            {
                var result = await _repo.GetCategoryWithDishesByCategoryNameAsync(category);

                if (result == null)
                {
                    return(NotFound());
                }
                return(Ok(_mapper.Map <CategoryModel>(result)));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }