Exemplo n.º 1
0
        public async Task <ISiteSettings> Fetch(long siteId)
        {
            var site = await queries.Fetch(siteId, CancellationToken);

            dataProtector.UnProtect(site);
            return(site);
        }
Exemplo n.º 2
0
        private async Task <TenantContext <SiteContext> > ResolveByFolderAsync(HttpContext context)
        {
            var siteFolderName = await GetContextIdentifier(context);

            TenantContext <SiteContext> tenantContext = null;

            CancellationToken cancellationToken = context?.RequestAborted ?? CancellationToken.None;

            var site = await siteRepo.FetchByFolderName(siteFolderName, cancellationToken);

            if (site != null)
            {
                dataProtector.UnProtect(site);
                var siteContext = new SiteContext(site);
                tenantContext = new TenantContext <SiteContext>(siteContext);
            }

            return(tenantContext);
        }