예제 #1
0
        internal static ErpIdentity GetIdentityFromCache(Guid userId)
        {
            ErpIdentity result = null;
            bool        found  = cache.TryGetValue <ErpIdentity>(userId.ToString(), out result);

            return(result);
        }
예제 #2
0
        internal static void AddIdentityToCache(Guid userId, ErpIdentity identity)
        {
            var options = new MemoryCacheEntryOptions();

            options.SetAbsoluteExpiration(TimeSpan.FromMinutes(5));
            cache.Set(userId.ToString(), identity, options);
        }
예제 #3
0
 public ErpPrincipal(ErpIdentity identity) : base()
 {
     AddIdentity(identity);
 }
예제 #4
0
 internal static void AddIdentityToCache(Guid userId, ErpIdentity identity)
 {
     var options = new MemoryCacheEntryOptions();
     options.SetAbsoluteExpiration(TimeSpan.FromMinutes(5));
     cache.Set(userId.ToString(), identity, options);
 }
예제 #5
0
        internal static void AddIdentityToCache(Guid userId, ErpIdentity identity)
        {
            var options = new MemoryCacheEntryOptions();
            options.SetAbsoluteExpiration(TimeSpan.FromMinutes(5));

            cache.Set(
                userId.ToString(),
                identity,
                options);
            // from bet4 to beta5 changed
            //context =>
            //{
            //	context.SetAbsoluteExpiration(TimeSpan.FromMinutes(5));
            //	return identity;
            //});
        }