public Task HandleAsync(DispatchEvent message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } Console.WriteLine($"Receiving 'DispatchEvent' for event type '{message.EventType.FullName}' with event '{message.Event}'."); return(_eventDispatcher.DispatchAsync(message.EventType, message.Event)); }
public async Task <IEventResult> HandleAsync(TEvent evt) { if (evt == null) { throw new ArgumentNullException(nameof(evt)); } var message = new DispatchEvent(typeof(TEvent), evt); Console.WriteLine($"Sending 'DispatchEvent' for event type '{message.EventType.FullName}' with event '{message.Event}'."); var answer = await _messageEndPoint.SendAsync <DispatchEvent, EventDispatchResult>(message); return(answer.EventResult); }