mccalltd/AttributeRouting — pull request #93 by gregmac (2012-07-23 20:37:21+00:00)
Title: Support for versioning (#91)

Works as described in issue #91.

Note for viewing the diff. 7b9396a and 48c9341 are my upstream merges, they do not have any actual effect.

I cannot figure out why git thinks RouteReflector is entirely changed, the actual diff is:

```

--- RouteReflector.cs.orig	Mon Jul 23 16:34:22 2012
+++ RouteReflector.cs	Mon Jul 23 16:22:38 2012
@@ -46,6 +46,7 @@
let convention = controllerType.GetCustomAttribute(false)
let routeAreaAttribute = controllerType.GetCustomAttribute(true)
let routePrefixAttribute = controllerType.GetCustomAttribute(true)
+ let routeVersionedAttribute = controllerType.GetCustomAttribute(true)
from actionMethod in controllerType.GetActionMethods(inheritActionsFromBaseController)
from routeAttribute in GetRouteAttributes(actionMethod, convention)
// precedence is within a controller
@@ -73,7 +74,10 @@
IsAbsoluteUrl = routeAttribute.IsAbsoluteUrl,
UseLowercaseRoute = routeAttribute.UseLowercaseRouteFlag,
PreserveCaseForUrlParameters = routeAttribute.PreserveCaseForUrlParametersFlag,
- AppendTrailingSlash = routeAttribute.AppendTrailingSlashFlag
+ AppendTrailingSlash = routeAttribute.AppendTrailingSlashFlag,
+ IsVersioned = routeVersionedAttribute != null && routeVersionedAttribute.IsVersioned,
+ MinVersion = routeAttribute.MinVersion ?? (routeVersionedAttribute != null ? routeVersionedAttribute.MinVersion : null),
+ MaxVersion = routeAttribute.MaxVersion ?? (routeVersionedAttribute != null ? routeVersionedAttribute.MaxVersion : null)
}).ToList();
}
```