예제 #1
0
        public async Task GetAllAsync_Not_Null_Not_Empty()
        {
            var yeasts = await _yeastRepository.GetAllAsync();

            Assert.NotNull(yeasts);
            Assert.True(yeasts.Any());
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }