public Task Invoke(HttpContext httpContext) { var injector = _options.GetInjector(); if (injector != null) { var builder = _builder.New(); injector(builder); builder.Run(_next); _subPipeline = builder.Build(); } if (_subPipeline != null) { return(_subPipeline(httpContext)); } return(_next(httpContext)); }
public Task Invoke(IDictionary <string, object> environment) { var injector = _options.GetInjector(); if (injector != null) { var builder = _builder.New(); injector(builder); builder.Use(new Func <AppFunc, AppFunc>(_ => _next)); _subPipeline = builder.Build(); } if (_subPipeline != null) { return(_subPipeline(environment)); } return(_next(environment)); }