public class OAuthConstraintAttribute : System.Web.Routing.IRouteConstraint
{
const string name = "oAuth";
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
{
return false;
}
}
DefaultInlineConstraintResolver defaultInlineConstraintResolver = new DefaultInlineConstraintResolver();
defaultInlineConstraintResolver.ConstraintMap.Add("oAuth", typeof(OAuthConstraintAttribute));
routes.MapMvcAttributeRoutes(defaultInlineConstraintResolver);
网友评论