12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #region Apache License Version 2.0
- #endregion Apache License Version 2.0
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Senparc.Weixin.Containers;
- namespace Senparc.Weixin.Helpers
- {
-
-
-
- public class ContainerHelper
- {
-
-
-
-
- public static string GetCacheKeyNamespace(Type bagType)
- {
- return string.Format("Container:{0}", bagType);
- }
-
-
-
-
-
- public static string GetItemCacheKey(Type bagType, string shortKey)
- {
- return string.Format("{0}:{1}", GetCacheKeyNamespace(bagType), shortKey);
- }
-
-
-
-
-
-
- public static string GetItemCacheKey(IBaseContainerBag bag)
- {
- return GetItemCacheKey(bag, bag.Key);
- }
-
-
-
-
-
-
-
- public static string GetItemCacheKey(IBaseContainerBag bag, string shortKey)
- {
- return GetItemCacheKey(bag.GetType(), shortKey);
- }
- }
- }
|