Tuesday, January 31, 2012

AttributeRouting, a ASP.NET MVC open source project

https://github.com/mccalltd/AttributeRouting/wiki/2.-Usage

Multiple Routes Mapped to a Single Action

You can specify multiple GET routes that map to a single action simply by adding more than one route attribute. This can be handy when supporting legacy urls. To specify the order of these routes, use the Order parameter. This is important because the first route will be used to generate outbound URLs.
  [GET("", Order = 1)]
  [GET("Posts", Order = 2)]
  [GET("Posts/Index", Order = 3)]
  public void Index()
  {
      return View();
  }

No comments:

Post a Comment