Ejemplo n.º 1
0
 protected NotificationDto(Guid id, IntegrationEvent @event, IntegrationEventType eventType,
                           ConfirmationType state, Importancy importancy) : this()
 {
     Id           = id;
     Event        = @event;
     EventType    = eventType;
     CreationTime = DateTime.UtcNow;
     State        = state;
     Importancy   = importancy;
 }
Ejemplo n.º 2
0
            static IntegrationEvent DeserializeDependingOnType(string @event, IntegrationEventType eventType)
            {
                switch (eventType)
                {
                case IntegrationEventType.ProductPublishedIntegrationEvent:
                    return(JsonSerializer.Deserialize <ProductPublishedIntegrationEvent>(@event));

                case IntegrationEventType.ProductPropertiesChangedIntegrationEvent:
                    return(JsonSerializer.Deserialize <ProductPropertiesChangedIntegrationEvent>(@event));

                case IntegrationEventType.ProductAddedIntegrationEvent:
                    return(JsonSerializer.Deserialize <ProductAddedIntegrationEvent>(@event));

                // ReSharper disable once RedundantCaseLabel
                default:
                case IntegrationEventType.Unknown:
                    return(JsonSerializer.Deserialize <IntegrationEvent>(@event));
                }
            }