public async Task <IEnumerable <YeastDto> > GetAllAsync() { var yeastsDto = await _yeastElasticsearch.GetAllAsync(); if (yeastsDto.Any()) { return(yeastsDto); } var yeasts = await _yeastRepository.GetAllAsync(); return(AutoMapper.Mapper.Map <IEnumerable <Yeast>, IEnumerable <YeastDto> >(yeasts)); }
public async Task <IEnumerable <YeastDto> > GetAllAsync(string custom) { var yeastsDto = await _yeastElasticsearch.GetAllAsync(custom); if (yeastsDto.Any()) { return(yeastsDto); } var yeasts = await _yeastRepository.GetAllAsync("Supplier"); yeastsDto = Mapper.Map <IEnumerable <Yeast>, IEnumerable <YeastDto> >(yeasts); return(yeastsDto); }