public static MultitenancyMiddlewareOptionsBuilder <TTenant> UsePerTenantMiddlewarePipeline <TTenant>(this MultitenancyMiddlewareOptionsBuilder <TTenant> builder, IApplicationBuilder rootAppBuilder) where TTenant : class { var options = new TenantPipelineMiddlewareOptions() { IsTerminal = false, RootApp = rootAppBuilder }; builder.ApplicationBuilder.UseMiddleware <TenantPipelineMiddleware <TTenant> >(options); return(builder); }
public static MultitenancyMiddlewareOptionsBuilder <TTenant> UsePerTenantMiddlewarePipeline <TTenant>(this MultitenancyMiddlewareOptionsBuilder <TTenant> builder, IAppBuilder rootAppBuilder, IServiceProvider appServices = null) where TTenant : class { var httpContextProvider = builder.ApplicationBuilder.ApplicationServices.GetRequiredService <IHttpContextProvider>(); var options = new TenantPipelineMiddlewareOptions() { IsTerminal = false, RootApp = rootAppBuilder, ApplicationServices = appServices, HttpContextProvider = httpContextProvider }; builder.ApplicationBuilder.UseMiddleware <TenantPipelineMiddleware <TTenant> >(options); return(builder); }