コード例 #1
0
            public override void AfterSave(Group entity, Document document)
            {
                var s = new TenantCacheStore(
                    _cache,
                    _tenants.GetTenantForRequest(HttpContext.Current)
                    );

                s.Invalidate(Key);
            }
コード例 #2
0
            public override void AfterSave(TEntity entity, Document document)
            {
                var s = new TenantCacheStore(
                    _cache,
                    _tenants.GetTenantForRequest(HttpContext.Current)
                    );
                var k = BuildKey(entity);

                if (s.ContainsKey(k))
                {
                    s.Replace(k, entity, TimeSpan.FromHours(1));
                }
            }
コード例 #3
0
            public override void AfterSave(User entity, Document document)
            {
                var s = new TenantCacheStore(
                    _cache,
                    _tenants.GetTenantForRequest(HttpContext.Current)
                    );
                var a = s.Get <IDictionary <string, UserSummary> >(Key);

                if (null != a)
                {
                    lock (a)
                    {
                        var summary = UserSummary.FromDomain(entity);
                        a[summary.Id] = summary;
                    }
                }
            }