Source/NFX.Wave/MVC/Controller.cs
/// <summary>
/// Returns cached (for performance)ordered array of ActionFilterAttributes for type
/// </summary>
Returns cached (for performance)ordered array of ActionFilterAttributes for type
Returns cached ( for performance ) ordered array of ActionFilterAttributes for type
protected static ActionFilterAttribute[] GetActionFilters(Type tp)
         {
            var dict = m_ClassFilters;
            ActionFilterAttribute[] filters = null;
            if (dict!=null && dict.TryGetValue(tp, out filters)) return filters;
            filters = tp.GetCustomAttributes().Where(atr => typeof(ActionFilterAttribute).IsAssignableFrom(atr.GetType()))
                                                              .Cast<ActionFilterAttribute>()
                                                              .OrderBy(a => a.Order)
                                                              .ToArray();
            var newDict = dict!=null ?  new Dictionary<Type, ActionFilterAttribute[]>( dict ) : new Dictionary<Type, ActionFilterAttribute[]>();
            newDict[tp] = filters;
            m_ClassFilters = newDict; 
            return filters;
         }
protected static ActionFilterAttribute [ ] GetActionFilters ( Type tp ) { var dict = m_ClassFilters ; ActionFilterAttribute [ ] filters = null ; if ( dict != null && dict . TryGetValue ( tp , out filters ) ) return filters ; filters = tp . GetCustomAttributes ( ) . Where ( atr => typeof ( ActionFilterAttribute ) . IsAssignableFrom ( atr . GetType ( ) ) ) . Cast < ActionFilterAttribute > ( ) . OrderBy ( a => a . Order ) . ToArray ( ) ; var newDict = dict != null ? new Dictionary < Type , ActionFilterAttribute [ ] > ( dict ) : new Dictionary < Type , ActionFilterAttribute [ ] > ( ) ; newDict [ tp ] = filters ; m_ClassFilters = newDict ; return filters ; }
Returns cached (for performance)ordered array of ActionFilterAttributes for type
Returns cached ( for performance ) ordered array of ActionFilterAttributes for type
//thread safe copy //thread safe swap
tp
Type