public async Task <Unit> Handle(UpdateAllergenCommand request, CancellationToken cancellationToken) { try { var entity = _mapper.Map <Allergen>(request.Allergen); await _repository.Update(entity, cancellationToken); _eventBus.Publish(new AllergenUpdatedEvent(request.Allergen)); return(Unit.Value); } catch (Exception e) { throw new UpdateException(request.Allergen.Id, e); } }