Esempio n. 1
0
 public IDisposable Use(string correlationId)
 {
     return(_commandScopeProvider.BeginScope(CommandContextKey, new CommandContext
     {
         CorrelationId = correlationId
     }));
 }
Esempio n. 2
0
        public int?ResolveTenantId()
        {
            if (!multiTenancy.Resolvers.Any())
            {
                return(null);
            }

            if (ambientScopeProvider.GetValue(AmbientScopeContextKey))
            {
                //Preventing recursive call of ResolveTenantId
                return(null);
            }

            using (ambientScopeProvider.BeginScope(AmbientScopeContextKey, true))
            {
                var cacheItem = cache.Value;
                if (cacheItem != null)
                {
                    return(cacheItem.TenantId);
                }

                var tenantId = GetTenantIdFromContributors();
                cache.Value = new TenantResolverCacheItem(tenantId);
                return(tenantId);
            }
        }
Esempio n. 3
0
        public IAuditSaveHandle BeginScope()
        {
            var ambientScope = _ambientScopeProvider.BeginScope(
                _ambientContextKey,
                new AuditScope(_auditingHelper.CreateAuditInfo())
                );

            Debug.Assert(Current != null, "Current != null");

            return(new DisposableSaveHandle(this, ambientScope, Current.Info, Stopwatch.StartNew()));
        }
Esempio n. 4
0
 public virtual IDisposable Use(int?tenantId, long?userId)
 {
     return(_sessionOverrideScopeProvider.BeginScope(MajidSessionBase.SessionOverrideContextKey, new SessionOverride(tenantId, userId)));
 }
Esempio n. 5
0
 public IDisposable Use(long?userId)
 {
     return(_sessionOverrideScopeProvider.BeginScope(StoveSessionBase.SessionOverrideContextKey, new SessionOverride(userId)));
 }
 public virtual IDisposable Use(string userId)
 {
     return(_sessionOverrideScopeProvider.BeginScope(SharePlatformSessionBase.SessionOverrideContextKey, new SessionOverride(userId)));
 }