public ActionResult <IEnumerable <BrewWithoutAdditionalInfoDto> > GetBrews(
            [FromQuery] BrewsResourceParameters brewsResourceParameters,
            [FromHeader(Name = ExtendedControllerBase.ACCEPT)] string mediaTypes)
        {
            if (!_propertyMappingService.ValidMappingExistsFor <BrewDto, Entities.Brew>
                    (brewsResourceParameters.OrderBy))
            {
                return(BadRequest());
            }

            var splitMediaTypes = mediaTypes.Split(',');

            if (!MediaTypeHeaderValue.TryParseList(splitMediaTypes,
                                                   out IList <MediaTypeHeaderValue> parsedMediaTypes))
            {
                return(BadRequest());
            }

            var brews = _homebrewRepository.GetBrews(brewsResourceParameters);

            var paginationMetaData = new
            {
                totalCount  = brews.TotalCount,
                pageSize    = brews.PageSize,
                currentPage = brews.CurrentPage,
                totalPages  = brews.TotalPages
            };

            Response.Headers.Add(this.PAGINATION_HEADER,
                                 JsonSerializer.Serialize(paginationMetaData));

            var shapedBrews = brewsResourceParameters.IncludeAdditionalInfo ?
                              _mapper.Map <IEnumerable <BrewDto> >(brews).ShapeData(null) :
                              _mapper.Map <IEnumerable <BrewWithoutAdditionalInfoDto> >(brews).ShapeData(null);

            if (parsedMediaTypes.Any(pmt => pmt.SubTypeWithoutSuffix.EndsWith(this.HATEOAS, StringComparison.InvariantCultureIgnoreCase)))
            {
                var links = CreateLinksForBrews(brewsResourceParameters,
                                                brews.HasNext,
                                                brews.HasPrevious);

                var shapedBrewsWithLinks = shapedBrews.Select(brew =>
                {
                    var brewAsDictionary = brew as IDictionary <string, object>;
                    var brewLinks        = CreateLinksForBrew((int)brewAsDictionary["Id"], false);
                    brewAsDictionary.Add(this.LINKS, brewLinks);
                    return(brewAsDictionary);
                });

                var linkedCollectionResource = new
                {
                    value = shapedBrewsWithLinks,
                    links
                };

                return(Ok(linkedCollectionResource));
            }

            return(Ok(shapedBrews));
        }