Beispiel #1
0
        public async Task Handle(ProductAddedDomainEvent @event, CancellationToken cancellationToken)
        {
            //Additional logic for product domain event handler e.g. validation, publish restriction.
            //event for e.g. SignalR
            var integrationEvent = new ProductAddedIntegrationEvent(@event.ProductId, @event.Name, @event.Price, @event.Manufacturer);

            await _productIntegrationEventService.AddAndSaveEventAsync(integrationEvent);
        }
        public async Task Handle(ProductPropertiesChangedDomainEvent @event, CancellationToken cancellationToken)
        {
            //Additional logic for product domain event handler e.g. validation, publish restriction.
            //event for e.g. SignalR
            var iEvent = new ProductPropertiesChangedIntegrationEvent(@event.ProductId,
                                                                      @event.Manufacturer,
                                                                      @event.Name,
                                                                      @event.Price,
                                                                      @event.Description,
                                                                      @event.Dimensions.Height,
                                                                      @event.Dimensions.Width,
                                                                      @event.Dimensions.Length,
                                                                      @event.Dimensions.Weight);

            await _productIntegrationEventService.AddAndSaveEventAsync(iEvent);
        }