Ejemplo n.º 1
0
 public static async Task Run(
     [QueueTrigger("events", Connection = "AzureStorage")] EventPublishedNotification myQueueItem,
     ILogger log,
     [Inject] IHandlerFactory factory)
 {
     await factory.Dispatch(myQueueItem);
 }
Ejemplo n.º 2
0
 public async Task Dispatch(EventPublishedNotification notification)
 {
     var @event         = notification.ToEvent();
     var subscriberType = Type.GetType(notification.SubscriberType);
     var subscriber     = this.ctx.GetInstance(subscriberType);
     await subscriber.ConsumeSubscribedEvent(@event);
 }
Ejemplo n.º 3
0
        public static IAggregateEvent ToEvent(this EventPublishedNotification notification)
        {
            var eventType = Type.GetType(notification.EventType);

            return((IAggregateEvent)JsonConvert.DeserializeObject(notification.EventJson, eventType));
        }