Exemplo n.º 1
0
        public async Task GetAllAsync_Not_Null_Not_Empty()
        {
            var yeasts = await _yeastRepository.GetAllAsync();

            Assert.NotNull(yeasts);
            Assert.True(yeasts.Any());
        }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }