// Build the middleware pipeline for the current tenant
        private IShellPipeline BuildTenantPipeline()
        {
            var appBuilder = new ApplicationBuilder(ShellScope.Context.ServiceProvider, _features);

            // Create a nested pipeline to configure the tenant middleware pipeline
            var startupFilters = appBuilder.ApplicationServices.GetService <IEnumerable <IStartupFilter> >();

            var shellPipeline = new ShellRequestPipeline();

            Action <IApplicationBuilder> configure = builder =>
            {
                ConfigureTenantPipeline(builder);
            };

            foreach (var filter in startupFilters.Reverse())
            {
                configure = filter.Configure(configure);
            }

            configure(appBuilder);

            shellPipeline.Next = appBuilder.Build();

            return(shellPipeline);
        }
Exemplo n.º 2
0
 private IShellPipeline BuildTenantPipeline()
 {
     V_0            = new ApplicationBuilder(ShellScope.get_Context().get_ServiceProvider(), this._features);
     stackVariable7 = ServiceProviderServiceExtensions.GetService <IEnumerable <IStartupFilter> >(V_0.get_ApplicationServices());
     V_1            = new ShellRequestPipeline();
     V_2            = new Action <IApplicationBuilder>(this.u003cBuildTenantPipelineu003eb__6_0);
     V_3            = stackVariable7.Reverse <IStartupFilter>().GetEnumerator();
     try
     {
         while (V_3.MoveNext())
         {
             V_2 = V_3.get_Current().Configure(V_2);
         }
     }
     finally
     {
         if (V_3 != null)
         {
             V_3.Dispose();
         }
     }
     V_2.Invoke(V_0);
     V_1.set_Next(V_0.Build());
     return(V_1);
 }