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); }
public void Intercept(IInvocation invocation) { _aspect.InvokeAsync(new InterceptorInvocationContext(invocation)); }
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) { var invocationContext = new MvcInvocationContext(context, next); await _aspects.InvokeAsync(invocationContext); }
public static void Invoke(this IAspect aspect, IInvocationContext context) { aspect.InvokeAsync(context).GetAwaiter().GetResult(); }