jsclayton / AttributeRouting

Define your routes using attributes on action methods in ASP.NET MVC.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please refer to the wiki pages for documentation.

If you encounter any issues using this library, please log them in the issue tracker. Thanks.

Major Features

  • Decorate your actions with GET, POST, PUT, DELETE, and verb agnostic attributes.
  • Map multiple routes to a single action, ordering them with an Order property.
  • Specify route defaults and constraints inline and also using attributes.
  • Specify optional params inline with a token before or after the parameter name.
  • Specify the route name for supporting named routes.
  • Define MVC areas on a controller or base controller.
  • Group or nest your routes together using route prefixes applied to a controller or base controller.
  • Support legacy urls.
  • Set the precedence of routes among the routes defined for an action, within a controller, and among controllers and base controllers.
  • Generate lowercase outbound urls automatically.
  • Define your own custom route conventions and apply them on a controller to generate the routes for actions within the controller without boilerplate attributes (think RESTful style).
  • Debug your routes using a supplied HttpHandler.

Changelog

v1.2.1

  • Issue 24 – fixed null reference in GetHttpMethod extension when inspecting routes in unit tests (ie: mocked http contexts).

v1.2

  • Used System.Web.WebHelpers to sniff the form and querystring collections hanging off the request for an http method override without triggering request xss validation.
  • Marked configuration object’s AddRemainingScannedRoutes method as obsolete beacause it is … obsolete.

v1.1

  • Fixed bug that occured when building route urls that have areas or prefixes that start with the route url, even when it is only a partial match.
  • Fixed reflection logic for finding action methods. Used to restrict to public instance methods that returned type assignable to ActionMethod; now simply returns public instance methods, in line with the true definition of an action method in MVC.

v1.0

  • Modified the base RouteAttribute to allow it to work without an http method constraint, so that an action can respond to any verb.
  • Added ability to specify optional parameter token (?) at either beginning or end of url param.
  • Added ability to specify route defaults inline with the url parameter.
  • Added ability to specify regex route constraints inline with the url parameter.

v0.8

  • Fixed bug in base route attribute that disallowed URLs like Somewhere/{*pathInfo}, barfing on the asterisk.

v0.7.4119

  • Added HEAD constraint to GET attribute so that all GET routes will respond to HEAD requests as well.
  • Fixed bug when testing whether a route starts with an area url applicable to the route. Previously it was comparing against the area name, which was recently made overridable, and part of this logic was not updated.
  • Fleshed out XML doc comments.
  • Fixed bug in ordering of routes for an action when using a RouteConvention.
  • Added T4 CodeTemplates for controllers and views to swap with the defaults provided in MVC projects.
  • Fixed bug in applying global route constraints — when more than one url parameter matches the specified regex, only the first one matched has the constraint applied. Corrected this so that each matched url parameter has the constraint applied.

v0.6.4033

  • Added IsAbsoluteUrl property to the RouteAttributes, which prevents the RouteAreaAttribute and RoutePrefixAttribute from prefixing the URL for a route. This can be handy for legacy URL support.
  • Added Precedence property to the RouteAtrributes, which allows you to specify the precedence of a route among all the routes defined for the controller.
  • New and improved output from the LogRoutesHandler.
  • New RouteConventionAttribute, which allows you to create your own convention-based route generator for actions within a controller. There is also a RestfulRouteConventionAttribute, which automatically creates RESTful routes for standard actions in your controller.

About

Define your routes using attributes on action methods in ASP.NET MVC.

License:MIT License


Languages

Language:C# 81.2%Language:ASP 18.7%Language:Shell 0.1%