public async Task <IActionResult> GetAllAsync() { try { var result = await foodService.GetAllAsync <FoodView>(); if (!result.Any()) { return(NoContent()); } return(Ok(result)); } catch (Exception) { return(BadRequest()); } }
public async Task <IEnumerable <FoodDto> > GetAll() { return(await _foodService.GetAllAsync()); }