public async Task <YeastDto> AddAsync(YeastDto yeastDto) { var yeast = Mapper.Map <YeastDto, Yeast>(yeastDto); await _yeastRepository.AddAsync(yeast); var result = await _yeastRepository.GetSingleAsync(yeast.YeastId, "Supplier"); var mappedResult = Mapper.Map <Yeast, YeastDto>(result); await _yeastElasticsearch.UpdateAsync(mappedResult); return(mappedResult); }
public async Task <YeastDto> AddAsync(YeastDto yeastDto) { var yeast = AutoMapper.Mapper.Map <YeastDto, Yeast>(yeastDto); await _yeastRepository.AddAsync(yeast); _logger.LogInformation($"YeastId: {yeast.YeastId}"); var result = await _yeastRepository.GetSingleAsync(yeast.YeastId); var mappedResult = AutoMapper.Mapper.Map <Yeast, YeastDto>(result); await _yeastElasticsearch.UpdateAsync(mappedResult); return(mappedResult); }