private static bool MethodActionIsMatch(MethodInfo method, HttpRequest request) { var attr = method.GetMyAttribute<ActionAttribute>(); if (attr != null) { if (attr.AllowExecute(request.HttpMethod)) return true; } return false; }
private ActionDescription CreatePageActionDescription(ControllerDescription controller, MethodInfo m) { ActionAttribute actionAttr = m.GetMyAttribute<ActionAttribute>(); if( actionAttr == null ) actionAttr = new ActionAttribute(); // 不指定就采用默认实例 return new ActionDescription(m, actionAttr) { PageController = controller }; }
public ActionDescription(MethodInfo m) : this(m, m.GetMyAttribute<ActionAttribute>()) { }