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