Exemple #1
0
        public Auto CreateAuto(Auto auto)
        {
            _autoRepository.Insert(auto);

            AutoCreatedEvent autoCreatedEvent = CreateAutoCreatedEvent(auto);

            _publisher.Publish(autoCreatedEvent);

            return(auto);
        }
Exemple #2
0
 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);
     }
 }