Routing Updates
Posted in C#, BlogSvc, MVC by JarrettV on 1/23/2009 10:30:19 AM - CST
I just
checked in a large refactor on the routing system to allow for
collection plug ins to register their own routes. All routing
implements the IRouteRegistrar interface that has
a RegisterRoutes method. The
BaseRouteRegistrar abstract base class contains
some useful implementation and logic that can be reused for plug-in
routing.
AtomPubRouteRegistrar the implementation for all the default routes. The default routes will always get registered after plug-in routes. Remember, order is important because routing always takes the first match.
Each collection can plug-in their own routing with a constraint that will ensure the routes are only active for the collection/collections that registered the routes.
Also, I added some extensions on top of UrlHelper that calls the RouteService class which has support for SSL routes and absolute routes. We lost automatic deep routes on threaded annotations. However, there's baked in support for "dated" entries. We are using named routes so that makes it really easy to select which route you want when generating the URL.
Comments
None.