//--------------------------------------------------------------------------------------------------------- private static Dictionary <String, IPageCache> loadIPageCaches() { Dictionary <String, IPageCache> results = new Dictionary <String, IPageCache>(); Dictionary <String, ControllerMeta> metas = ControllerMeta.GetMetaDB(); foreach (KeyValuePair <String, ControllerMeta> kv in metas) { ControllerMeta controller = kv.Value; foreach (KeyValuePair <String, ControllerAction> caKv in controller.ActionMaps) { ControllerAction action = caKv.Value; foreach (Attribute a in action.AttributeList) { CachePageAttribute cachedInfo = a as CachePageAttribute; if (cachedInfo == null) { continue; } IPageCache obj = (IPageCache)ObjectContext.GetByType(cachedInfo.Type); results.Add(controller.ControllerType.FullName + "_" + action.ActionName, obj); } } } return(results); }
private static ControllerAction loadControllerAction(MethodInfo m) { ControllerAction action = new ControllerAction(); action.MethodInfo = m; action.ActionName = m.Name; action.AttributeList = new List <Attribute>(); object[] attrs = rft.GetAttributes(m); foreach (Attribute attr in attrs) { action.AttributeList.Add(attr); } return(action); }
private static ControllerAction loadControllerAction( MethodInfo m ) { ControllerAction action = new ControllerAction(); action.MethodInfo = m; action.ActionName = m.Name; action.AttributeList = new List<Attribute>(); object[] attrs = rft.GetAttributes( m ); foreach (Attribute attr in attrs) { action.AttributeList.Add( attr ); } return action; }