コード例 #1
0
ファイル: CacheRouteMapping.cs プロジェクト: githuer/DMSFrame
 internal void SetQueryCache(string key, CacheRouteInfo value)
 {
     if (Interlocked.Increment(ref collect) == COLLECT_PER_ITEMS)
     {
         CollectCacheGarbage();
     }
     _queryCache[key] = value;
 }
コード例 #2
0
ファイル: CacheRouteMapping.cs プロジェクト: githuer/DMSFrame
 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
ファイル: CacheRouteMapping.cs プロジェクト: githuer/DMSFrame
        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);
        }