示例#1
0
 public void Remove(string key)
 {
     key = GXUtil.NormalizeKey(key);
     GXLogging.Debug(log, "Remove key: " + key);
     if (_httpSession != null)
     {
         GXLogging.Debug(log, "Remove SessionId : " + _httpSession.SessionID);
         _httpSession.Remove(key);
     }
 }
示例#2
0
 public void SetObject(string key, object val)
 {
     key = GXUtil.NormalizeKey(key);
     GXLogging.Debug(log, "Set Key" + key + "=" + val);
     if (_httpSession != null)
     {
         GXLogging.Debug(log, "SetObject SessionId : " + _httpSession.SessionID);
         _httpSession[key] = val;
     }
 }
示例#3
0
 public object GetObject(string key)
 {
     key = GXUtil.NormalizeKey(key);
     if (_httpSession != null)
     {
         GXLogging.Debug(log, "GetObject SessionId : " + _httpSession.SessionID);
         if (_httpSession[key] == null)
         {
             return(null);
         }
         return(_httpSession[key]);
     }
     return(null);
 }
示例#4
0
        public void Set <T>(string key, T val) where T : class
        {
            key = GXUtil.NormalizeKey(key);
            GXLogging.Debug(log, "Set Key" + key + "=" + val);
            if (_httpSession != null)
            {
                GXLogging.Debug(log, "SetObject SessionId : " + _httpSession.SessionID);
#if NETCORE
                _httpSession[key] = JSONHelper.Serialize <T>(val);
#else
                _httpSession[key] = val;
#endif
            }
        }
示例#5
0
        public T Get <T>(string key) where T : class
        {
            key = GXUtil.NormalizeKey(key);
            if (_httpSession != null)
            {
                GXLogging.Debug(log, "GetObject SessionId : " + _httpSession.SessionID);
                if (_httpSession[key] == null)
                {
                    return(null);
                }
#if NETCORE
                return(JSONHelper.DeserializeNullDefaultValue <T>(_httpSession[key]));
#else
                return((T)_httpSession[key]);
#endif
            }
            return(null);
        }
示例#6
0
 public string Get(string key)
 {
     key = GXUtil.NormalizeKey(key);
     if (_httpSession != null)
     {
         GXLogging.Debug(log, "GetObject SessionId : " + _httpSession.SessionID);
         if (_httpSession[key] == null)
         {
             GXLogging.Debug(log, "Get key: " + key + " is Empty");
             return(string.Empty);
         }
         else
         {
             object value = _httpSession[key];
             GXLogging.Debug(log, "Get key: " + key + "=" + value.ToString());
             return(value.ToString());
         }
     }
     return(string.Empty);
 }
示例#7
0
 public void Remove(string key)
 {
     key = GXUtil.NormalizeKey(key);
     RemoveHashValue(key);
 }
示例#8
0
 public Object GetObject(string key)
 {
     key = GXUtil.NormalizeKey(key);
     return(GetHashValueObj(key));
 }
示例#9
0
 public string Get(string key)
 {
     key = GXUtil.NormalizeKey(key);
     return(GetHashValue(key));
 }
示例#10
0
 public void SetObject(string key, Object val)
 {
     key = GXUtil.NormalizeKey(key);
     PutHashValue(key, val);
 }
示例#11
0
 public T Get <T>(string key) where T : class
 {
     key = GXUtil.NormalizeKey(key);
     return((T)GetHashValueObj(key));
 }
示例#12
0
 public void Set <T>(string key, T val) where T : class
 {
     key = GXUtil.NormalizeKey(key);
     PutHashValue(key, val);
 }