Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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);
        }