public TenantShellRestarter(
     IHttpContextProvider httpContextProvider,
     TenantIdentifierAccessor <TTenant> tenantDistinguisherAccessor,
     ITenantShellResolver <TTenant> tenantResolver)
 {
     _httpContextProvider         = httpContextProvider;
     _tenantDistinguisherAccessor = tenantDistinguisherAccessor;
     _tenantResolver = tenantResolver;
 }
        public TenantShellAccessor(ITenantShellFactory <TTenant> tenantFactory,
                                   TenantIdentifierAccessor <TTenant> tenantDistinguisherAccessor,
                                   ITenantShellResolver <TTenant> tenantResolver)
        {
            _tenantFactory = tenantFactory;
            _tenantDistinguisherAccessor = tenantDistinguisherAccessor;
            _tenantResolver = tenantResolver;

            CurrentTenantShell = new Lazy <Task <TenantShell <TTenant> > >(async() =>
            {
                var identifier = await _tenantDistinguisherAccessor.TenantDistinguisher.Value;
                if (identifier == null)
                {
                    return(null);
                }

                return(await _tenantResolver.ResolveTenantShell(identifier, _tenantFactory));
            });
        }