private static Task <Response> InvokePreRequestHook(NancyContext context, CancellationToken cancellationToken, BeforePipeline pipeline) { if (pipeline == null) { return(TaskHelpers.GetCompletedTask <Response>(null)); } return(pipeline.Invoke(context, cancellationToken)); }
private static void InvokePreRequestHook(NancyContext context, BeforePipeline pipeline) { if (pipeline != null) { var preRequestResponse = pipeline.Invoke(context); if (preRequestResponse != null) { context.Response = preRequestResponse; } } }
private static Task<Response> InvokePreRequestHook(NancyContext context, CancellationToken cancellationToken, BeforePipeline pipeline) { return pipeline == null ? Task.FromResult<Response>(null) : pipeline.Invoke(context, cancellationToken); }
private static Task <Response> InvokePreRequestHook(NancyContext context, CancellationToken cancellationToken, BeforePipeline pipeline) { return(pipeline == null?Task.FromResult <Response>(null) : pipeline.Invoke(context, cancellationToken)); }
private static Task<Response> InvokePreRequestHook(NancyContext context, CancellationToken cancellationToken, BeforePipeline pipeline) { if (pipeline == null) { return TaskHelpers.GetCompletedTask<Response>(null); } return pipeline.Invoke(context, cancellationToken); }