public async Task GetAllAsync_Not_Null_Not_Empty() { var yeasts = await _yeastRepository.GetAllAsync(); Assert.NotNull(yeasts); Assert.True(yeasts.Any()); }
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); }