public void UpdateContainerBag(string key, IBaseContainerBag bag)
 {
     if (_cache.ContainsKey(key))
     {
         var containerItemCollection = _cache[key];
         containerItemCollection[bag.Key] = bag;
     }
 }
        public void UpdateContainerBag(string key, IBaseContainerBag bag)
        {
            if (_cache.ContainsKey(key))
            {
                var containerItemCollection = Get(key);
                containerItemCollection[bag.Key] = bag;

                //因为这里获取的是containerItemCollection引用对象,所以不必再次更新整个containerItemCollection到缓存
            }
        }
        public void UpdateContainerBag(string key, IBaseContainerBag containerBag)
        {
            if (this.CheckExisted(key))
            {
                var containerItemCollection = Get(key);
                containerItemCollection[containerBag.Key] = containerBag;

                Update(key, containerItemCollection);
            }
        }
        public void UpdateContainerBag(string key, IBaseContainerBag containerBag)
        {
            if (this.CheckExisted(key))
            {
                var containerItemCollection = Get(key);
                containerItemCollection[containerBag.Key] = containerBag;

                var hash = GetHash();
                _cache.SetEntryInHash(hash, key, containerItemCollection);
            }
        }
 public void UpdateContainerBag(string key, IBaseContainerBag containerBag)
 {
     object value;
     if (_cache.TryGet(key,out value))
     {
         var containerItemCollection = (IContainerItemCollection) value;
         containerItemCollection[containerBag.Key] = containerBag;
     }
 }
        public void UpdateContainerBag(string key, IBaseContainerBag containerBag)
        {
            if (this.CheckExisted(key))
            {
                var containerItemCollection = Get(key);
                containerItemCollection[containerBag.Key] = containerBag;

                _cache.HashSet(key, containerItemCollection.ToHashEntries());
            }
        }
 /// <summary>
 /// 获取ContainerBag缓存Key,包含命名空间(形如:Container:Senparc.Weixin.MP.Containers.AccessTokenBag:wx669ef95216eef885)
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="bag"></param>
 /// <param name="shortKey"></param>
 /// <returns></returns>
 public static string GetItemCacheKey(IBaseContainerBag bag, string shortKey)// where T : IBaseContainerBag
 {
     return GetItemCacheKey(bag.GetType(), shortKey);
 }
 /// <summary>
 /// 获取ContainerBag缓存Key,包含命名空间(形如:Container:Senparc.Weixin.MP.Containers.AccessTokenBag:wx669ef95216eef885)
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="bag"></param>
 /// <returns></returns>
 public static string GetItemCacheKey(IBaseContainerBag bag)
 {
     return GetItemCacheKey(bag, bag.Key);
 }