public Auto CreateAuto(Auto auto) { _autoRepository.Insert(auto); AutoCreatedEvent autoCreatedEvent = CreateAutoCreatedEvent(auto); _publisher.Publish(autoCreatedEvent); return(auto); }
public void OnAutoCreated(AutoCreatedEvent incomingEvent) { try { _autoRepo.Insert(new Auto() { Id = incomingEvent.AutoId, Kenteken = incomingEvent.Kenteken, KlantId = incomingEvent.KlantId, Type = incomingEvent.Type, }); } catch (Exception e) { ExceptionEventPublisher.PublishException(e); } }