public static Lazy <Task <AppFunc> > GetOrAddMiddlewarePipeline <TTenant>(this TenantShell <TTenant> tenantShell, Lazy <Task <AppFunc> > requestDelegateFactory) where TTenant : class { var property = tenantShell.GetOrAddProperty(nameof(TenantShellPipelineExtensions), requestDelegateFactory); tenantShell.RegisterCallbackOnDispose(() => { if (requestDelegateFactory.IsValueCreated) { requestDelegateFactory.Value?.Dispose(); } }); return(property); }
public static Lazy <ICabinet> GetOrAddTenantFileSystem <TTenant>(this TenantShell <TTenant> tenantShell, string key, Lazy <ICabinet> factory) where TTenant : class { return(tenantShell.GetOrAddProperty(key, factory) as Lazy <ICabinet>); }
public static Lazy <Task <RequestDelegate> > GetOrAddMiddlewarePipeline <TTenant>(this TenantShell <TTenant> tenantShell, Lazy <Task <RequestDelegate> > requestDelegateFactory) where TTenant : class { return(tenantShell.GetOrAddProperty <Lazy <Task <RequestDelegate> > >(nameof(TenantShellPipelineExtensions), requestDelegateFactory)); }