Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Feature: Decouple attribute routing from attributes [1464]

$
0
0
Attribute routing (or rather, direct routing) shouldn't necessarily be tied to attributes. Just like filter providers can be used to get filters from other places, the same should be true for attribute routing.

Also, the default (attribute) implementation should allow plugging in a custom direct route builder, for cases where the standard RouteAttribute is used but a custom interpretation of the route template is desired.

This feature will enable as a scenario allowing derived class to inherit routes (which is currently disabled by default).

(This work applies to both MVC and Web API.)

Note, when making these changes, some existing Contract.Asserts will need to become exception handling paths.
In RouteInfoDirectRouteFactory.cs, line 41:
IDirectRouteBuilder builder = context.CreateBuilder(_infoProvider.Template);
Contract.Assert(builder != null);

In RouteFactoryAttribute.cs, line 69:
IDirectRouteBuilder builder = context.CreateBuilder(Template);
Contract.Assert(builder != null);

In RouteAttribute.cs, line 49:
IDirectRouteBuilder builder = context.CreateBuilder(Template);
Contract.Assert(builder != null);

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>