Пример #1
0
 internal void SetQueryCache(string key, CacheRouteInfo value)
 {
     if (Interlocked.Increment(ref collect) == COLLECT_PER_ITEMS)
     {
         CollectCacheGarbage();
     }
     _queryCache[key] = value;
 }
Пример #2
0
 internal bool TryGetQueryCache(string key, out CacheRouteInfo value)
 {
     key = key.ToLower();
     if (_queryCache.TryGetValue(key, out value))
     {
         value.RecordHit();
         return(true);
     }
     value = null;
     return(false);
 }
Пример #3
0
        private CacheRouteInfo InitializeCacheRouteInfo(string name, Type c, MethodInfo m, RouteSettingAttribute attribute)
        {
            CacheRouteInfo routeInfo = new CacheRouteInfo()
            {
                Key         = name,
                ClassType   = c,
                Method      = m,
                Parameters  = null,
                ParamReader = null,
                RightsName  = attribute == null ? string.Empty : attribute.RightsName,
                RouteFlags  = attribute == null ? RouteFlags.Default : attribute.RouteFlags,
                Description = attribute == null ? string.Empty : attribute.Description,
            };

            return(routeInfo);
        }