private YeastStepDto GetYeastStepDto(Model.BeerXml.Yeast yeast)
        {
            var yeastDto = _yeastElasticsearch.SearchAsync(yeast.Name, 0, 1).Result.FirstOrDefault();

            if (yeastDto == null)
            {
                return(null);
            }
            ;
            var yeastStepDto = AutoMapper.Mapper.Map <YeastDto, YeastStepDto>(yeastDto);

            double amount = (yeast.Amount != null) ? double.Parse(yeast.Amount, CultureInfo.InvariantCulture) : 0;

            yeastStepDto.Amount = (int)Math.Round(amount, 0);
            return(yeastStepDto);
        }
Example #2
0
 public async Task <IEnumerable <YeastDto> > SearchAsync(string query, int from, int size)
 {
     return(await _yeastElasticsearch.SearchAsync(query, from, size));
 }