CreateFromAsyncContext() public static method

public static CreateFromAsyncContext ( IAsyncExecutionContext asyncContext ) : IExecutionContext
asyncContext IAsyncExecutionContext
return IExecutionContext
Example #1
0
 /// <summary>
 /// Calls pre invoke logic before calling the next handler
 /// in the pipeline.
 /// </summary>
 /// <param name="executionContext">The execution context which contains both the
 /// requests and response context.</param>
 /// <returns>IAsyncResult which represent an async operation.</returns>
 public override IAsyncResult InvokeAsync(IAsyncExecutionContext executionContext)
 {
     PreInvoke(ExecutionContext.CreateFromAsyncContext(executionContext));
     return(base.InvokeAsync(executionContext));
 }
 /// <summary>
 /// Captures the overall execution time and logs final metrics.
 /// </summary>
 /// <param name="executionContext">The execution context, it contains the
 /// request and response context.</param>
 protected override void InvokeAsyncCallback(IAsyncExecutionContext executionContext)
 {
     executionContext.RequestContext.Metrics.StopEvent(Metric.ClientExecuteTime);
     this.LogMetrics(ExecutionContext.CreateFromAsyncContext(executionContext));
     base.InvokeAsyncCallback(executionContext);
 }
Example #3
0
 /// <summary>
 /// Calls the PostInvoke methods after calling the next handler
 /// in the pipeline.
 /// </summary>
 /// <param name="executionContext">The execution context, it contains the
 /// request and response context.</param>
 protected override void InvokeAsyncCallback(IAsyncExecutionContext executionContext)
 {
     PostInvoke(ExecutionContext.CreateFromAsyncContext(executionContext));
     base.InvokeAsyncCallback(executionContext);
 }
Example #4
0
 protected override void InvokeAsyncCallback(IAsyncExecutionContext executionContext)
 {
     if (executionContext.ResponseContext.AsyncResult.Exception == null && HandleRedirect(ExecutionContext.CreateFromAsyncContext(executionContext)))
     {
         base.InvokeAsync(executionContext);
     }
     else
     {
         base.InvokeAsyncCallback(executionContext);
     }
 }