Esempio n. 1
0
        public async Task <TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate <TResponse> next)
        {
            var invocationContext = new MediatrInvocationContext <TRequest, TResponse>(request, cancellationToken, next);

            await _aspects.InvokeAsync(invocationContext);

            return((TResponse)invocationContext.ReturnValue);
        }
Esempio n. 2
0
 public void Intercept(IInvocation invocation)
 {
     _aspect.InvokeAsync(new InterceptorInvocationContext(invocation));
 }
Esempio n. 3
0
 public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
 {
     var invocationContext = new MvcInvocationContext(context, next);
     await _aspects.InvokeAsync(invocationContext);
 }
Esempio n. 4
0
 public static void Invoke(this IAspect aspect, IInvocationContext context)
 {
     aspect.InvokeAsync(context).GetAwaiter().GetResult();
 }