Example #1
0
 public void Publish(GetService getService, object request)
 {
     foreach (var handler in _methods.GetMethods())
     {
         var concreteHandler = getService(handler.HandlerType);
         handler.Action(concreteHandler, (TRequest)request);
     }
 }
Example #2
0
 public async Task PublishAsync(GetService getService, object request)
 {
     foreach (var handler in _methods.GetMethods())
     {
         var concreteHandler = getService(handler.HandlerType);
         await handler.Action(concreteHandler, (TRequest)request);
     }
 }
Example #3
0
 public async Task PublishAsync(GetService getService, object request, CancellationToken cancellationToken)
 {
     foreach (var handler in _methods.GetMethods())
     {
         var concreteHandler = getService(handler.HandlerType);
         await handler.Action(concreteHandler, request, cancellationToken);
     }
 }