Exemplo n.º 1
0
 internal string GetGroupName(MethodBase method)
 {
     if ((m_Keys == null || m_Keys.Count <= 0) && method.GetParameters().Length <= 0)
     {
         return(null);
     }
     return(CacheKeyGenerator.GenerateGroupName(method));
 }
Exemplo n.º 2
0
        public string CacheRemoveByMethodName(string cacheName, string methodName)
        {
            string[]   array        = methodName.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
            string     fullName     = string.Join(".", array, 0, array.Length - 1);
            string     assemblyName = string.Join(".", array, 0, array.Length - 2);
            string     method       = array[array.Length - 1];
            Type       type         = Type.GetType(fullName + ", " + assemblyName);
            MethodInfo me           = type.GetMethod(method);
            string     group        = CacheKeyGenerator.GenerateGroupName(me);
            string     key          = CacheKeyGenerator.GenerateKeyName(me, null, null);
            ICache     cache        = CacheFactory.GetInstance(cacheName);

            cache.Remove(key);
            cache.RemoveByGroup(group);
            return("Succeed");
        }