コード例 #1
0
        public static (Pipeline <TIn, TOut>, bool) TryGetPipeline <TIn, TOut>(
            this PipelineInstructions <TIn, TOut> instructions,
            IServiceProvider sp)
        {
            if (!instructions.Validate())
            {
                return(null, false);
            }

            var middleware = BuildMiddleware(instructions, sp);
            var pipeline   = new Pipeline <TIn, TOut>(
                instructions.ParseModel, instructions.ParseResponse, middleware);

            return(pipeline, true);
        }
コード例 #2
0
 public static Middleware <TOut> BuildMiddleware <TIn, TOut>(
     this PipelineInstructions <TIn, TOut> instructions, IServiceProvider sp)
 => BuildMiddleware(instructions.MiddlewareFunction, sp);
コード例 #3
0
 public static (Pipeline <NoType, TOut>, bool) TryGetPipeline <TOut>(
     this PipelineInstructions <TOut> instructions,
     IServiceProvider sp) => instructions.TryGetPipeline <NoType, TOut>(sp);