public async Task <BeerStyleCompleteDto> GetBeerStyles(int from = 0, int size = 20) { if (size > 1000) { size = 1000; } var beerStylesDto = await _beerStyleService.GetAllAsync(from, size); var response = new BeerStyleCompleteDto() { BeerStyles = beerStylesDto.ToList() }; return(response); }
public async Task <IActionResult> GetBeerStyle(int id) { var beerStyleDto = await _beerStyleService.GetSingleAsync(id); if (beerStyleDto == null) { return(NotFound()); } var response = new BeerStyleCompleteDto() { BeerStyles = new List <BeerStyleDto>() }; response.BeerStyles.Add(beerStyleDto); return(Ok(response)); }