Esempio n. 1
0
        public async Task <IActionResult> GetAllAsync()
        {
            try
            {
                var result = await foodService.GetAllAsync <FoodView>();

                if (!result.Any())
                {
                    return(NoContent());
                }

                return(Ok(result));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Esempio n. 2
0
 public async Task <IEnumerable <FoodDto> > GetAll()
 {
     return(await _foodService.GetAllAsync());
 }