Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 nuget
Octocat-spinner-32 src
Octocat-spinner-32 t4
Octocat-spinner-32 tools
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AttributeRouting.targets
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.textile
Octocat-spinner-32 build.bat
Octocat-spinner-32 build.xml
README.textile

Please refer to the wiki pages for documentation.

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

Changelog

v2.3

  • #81 – Updated Web API references from Beta to RC. Fixed a few compilation erros due to switch.

v2.2.3

  • Fixed bug in RestfulHttpMethodContraint for web projects. Was not honoring http method overrides in request headers, forms, or query collections.
  • Implemented one of Sam Saffron’s performance enhancements for speeding up route table lookups.
  • #82 – added OPTIONS verb to GET/PUT/POST/DELETE attributes in web API attributes.
  • Removed references to MVC2, now using MVC3.

v2.2.2

  • #71 – fixed bug in regex pattern matching when multiple url parameters existed for a single url segment.

v2.2.1

  • #65 – fixed bug introduced in v2.* that arises when using the RouteAttribute on actions without specifying a verb.

v2.2

v2.1.1

  • #63 – BREAKING CHANGE! Fixed issue with ambigous routes in MVC controllers. All prior versions worked from AttributeRouting.VERBAttribute, and these have moved into MVC and Web API specific versions to handle disambiguation: AttributeRouting.Web.Mvc.VERBAttribute and AttributeRouting.Web.Http.VERBAttribute.

v2.1

  • #60 – can now override global configuration settings for UseLowercaseRoutes, PreserveCaseForUrlParameters, and AppendTrailingSlash via similarly named properties on the route attributes (GET, POST, PUT, DELETE, and Route).

v2.0

  • #57, #52 Added support for Web API, both Web-hosted and Self-hosted
    – Added new Nuget packages, AttributeRouting.WebApi and AttributeRouting.WebApi.Hosted

v1.7

  • #53 – added config setting for resolving the current UI culture name when constraining inbound requests.
  • #56 – Added Configuration to inherit actions defined on a base controller
  • #54 – fixed null ref exception when hitting routes.axd

v1.6

  • Can now choose to preserve the case for url parameters
  • Added logic and config option to constrain routes by the culture name of the current thread. The route is considered when: 1) no translations exist for the route; 2) it is translated for the current UI culture; 3) it is translated for the neutral culture when no translation exists for the specific culture. This constraint logic follow the logic used when choosing the translation to use when generating outbound routes.

v1.5.4426

  • Made modification to configuration of route translation providers. Used to be config.TranslationProvider = …, now it is config.AddTranslationProvider(). This allows adding multiple providers. THIS IS A BREAKING CHANGE. Please see the wiki page regarding [[Localization]].

v1.5

  • Added localization support via TranslationProvider configuration option.
  • Added support for mapping areas to static subdomains.

v1.4

  • Fixed logic in getting values from form and querystring collections, so that no errors are thrown during “potentially dangerous requests” when System.Web.Helpers is available.
  • Added ability to append trailing slash to URL path of outgoing URLs.
  • Support custom route handler factory.

v1.3.2

  • Removed reference to System.Web.WebPages in AR. Now, when checking for form or query values for the http method override, AR is dynamically checking for System.Web.WebPages, and if found, will use the Unvalidated collection rather than request.form or request.querystring.

v1.3.1

  • Fixed bug I introduced when trying to exclude route params from lowercase route generation. Will try again later.

v1.3

  • Issue 18 – allowed route params case to be preserved while lowercasing the area, controller, and action.
  • Identify controllers that do not inherit from Controller
  • Add strongly typed way to specify allowed HTTP methods for RouteAttribute

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.
Something went wrong with that request. Please try again.