public async Task <IEnumerable <BeerDto> > GetLastAsync(int @from, int size) { var lastBeersDto = await _beerElasticsearch.GetLastAsync(from, size); if (lastBeersDto != null) { return(lastBeersDto); } var lastBeers = await _beerRepository.GetLastAsync(from, size, //"Recipe.MashSteps", "Recipe.MashSteps.Hops", "Recipe.MashSteps.Fermentables", "Recipe.MashSteps.Others", // "Recipe.BoilSteps", "Recipe.BoilSteps.Hops", "Recipe.BoilSteps.Fermentables", "Recipe.BoilSteps.Others", // "Recipe.FermentationSteps", "Recipe.FermentationSteps.Hops", "Recipe.FermentationSteps.Fermentables", "Recipe.FermentationSteps.Others", "Recipe.FermentationSteps.Yeasts", // "Forks" "Forks.ABV", "Forks.BeerStyle", "Forks.IBU", "Forks.SRM", "ABV", "IBU", "SRM", "Brewers.User", "Breweries"); return(Mapper.Map <IList <Beer>, IEnumerable <BeerDto> >(lastBeers)); }
public async Task <IEnumerable <BeerDto> > GetLastAsync(int @from, int size) { var lastBeersDto = await _beerElasticsearch.GetLastAsync(from, size); if (lastBeersDto != null) { return(lastBeersDto); } var lastBeers = await _beerRepository.GetLastAsync(from, size); return(AutoMapper.Mapper.Map <IEnumerable <Beer>, IEnumerable <BeerDto> >(lastBeers)); }