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);
        }
Пример #2
0
 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>);
 }
Пример #3
0
 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));
 }