Esempio n. 1
0
        public static FilterHandler InitMethodHandler(string sessionID, MethodInfo method, List <IFilterAttribute> filters)
        {
            var handler = FilterHandler.GetSessionHandler(sessionID);

            if (filters == null || filters.Count == 0)
            {
                return(handler);
            }
            string name = string.Format("{0}.{1}", method.DeclaringType.FullName, method.Name);

            if (handler.MetaData.ContainsKey(name))
            {
                filters = handler.MetaData[name];
            }
            else
            {
                handler.MetaData[name] = filters;
            }
            filters.Sort((l, r) =>
            {
                return(l.Index - r.Index);
            });
            return(handler);
        }
Esempio n. 2
0
 public static void Clear(string sessionName = null)
 {
     FilterHandler.DestroySession(sessionName);
 }