Example #1
0
        public async Task <ActionResult <Model.Receita> > GetByCategoriaAsync(int id)
        {
            try
            {
                var receitas = await _service.GetPorCategoriaAsync(id);

                if (receitas.Count() > 0)
                {
                    return(new OkObjectResult(receitas));
                }

                return(new NotFoundResult());
            }
            catch (Exception ex)
            {
                return(new BadRequestObjectResult(ex));
            }
        }