Пример #1
0
        public async Task When(IDomainEvent @event)
        {
            _logger.LogInformation($"Sending event: {@event.GetType()}");

            // translate to integration event
            IntegrationEvent integrationEvent = null;

            switch (@event)
            {
            case RitCreated ritCreated:
                integrationEvent = new IntegrationEvents.RitCreated(ritCreated.Name, ritCreated.BeginStand, ritCreated.BeginStandId, ritCreated.EindStand, ritCreated.EindStandId, ritCreated.Id);
                break;

            case RitUpdated ritUpdated:
                integrationEvent = new IntegrationEvents.RitUpdated(ritUpdated.BeginStand, ritUpdated.BeginStandId, ritUpdated.EindStand, ritUpdated.EindStandId, ritUpdated.Id, ritUpdated.Name);
                break;

            default:
                break;
            }

            if (integrationEvent != null)
            {
                _integrationEventBus.Publish(integrationEvent);
            }
        }
        public async Task When(IDomainEvent @event)
        {
            _logger.LogInformation($"Sending event: {@event.GetType()}");

            // translate to integration event
            IntegrationEvent integrationEvent = null;

            switch (@event)
            {
            case KmStandCreated kmStandCreated:
                integrationEvent = new IntegrationEvents.KmStandCreated(kmStandCreated.Id, kmStandCreated.Stand, kmStandCreated.Datum, kmStandCreated.AdresId);
                break;

            default:
                break;
            }

            if (integrationEvent != null)
            {
                _integrationEventBus.Publish(integrationEvent);
            }
        }