internal static ErpIdentity GetIdentityFromCache(Guid userId) { ErpIdentity result = null; bool found = cache.TryGetValue <ErpIdentity>(userId.ToString(), out result); return(result); }
internal static void AddIdentityToCache(Guid userId, ErpIdentity identity) { var options = new MemoryCacheEntryOptions(); options.SetAbsoluteExpiration(TimeSpan.FromMinutes(5)); cache.Set(userId.ToString(), identity, options); }
public ErpPrincipal(ErpIdentity identity) : base() { AddIdentity(identity); }
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; //}); }