public async Task CreateAsync(PestDto pestDto) { var pest = _mapper.Map <Pest>(pestDto); pest.Id = Guid.NewGuid(); await _repository.CreateAsync(pest); }
public async Task UpdateAsync(PestDto pestDto) { var pest = await _repository.GetAsync(pestDto.Id); if (pest == null) { throw new GreenFieldNotFoundException(); } pest = _mapper.Map <Pest>(pestDto); await _repository.UpdateAsync(pest); }