aspnet / Routing

[Archived] Middleware for routing requests to application logic. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
272 stars 122 forks source link

Add support for required values to RoutePattern #912

Closed rynowak closed 5 years ago

rynowak commented 5 years ago

This change adds first class support for what MVC does to substitute route values into templates. Rather than munging strings, I chose to introduce required values as a fundamental concept.

The idea is that a conventional-route-style template could we written once, and then expanded for every action and controller that exists. Making this first class in routing moves the complexity into the right place, and will reduce the number of endpoints produced for a conventionally routed application significantly.

Still left to do here is to add support to DfaMatcher to process the required values. Then we should probably obsolete IRouteValuesAddressMetadata since it's now first class.

rynowak commented 5 years ago

@JamesNK updated - if you're happy with the state of things, feel free to add the DFA matcher part.

JamesNK commented 5 years ago

Looks good to me.

JamesNK commented 5 years ago

Then we should probably obsolete IRouteValuesAddressMetadata since it's now first class.

IRouteValuesAddressMetadata has route name. It would either be new metadata or on RoutePattern as well.

rynowak commented 5 years ago

IRouteValuesAddressMetadata has route name. It would either be new metadata or on RoutePattern as well

yeah exactly 😁

rynowak commented 5 years ago

Did you plan for me to merge this into master or are you going to build on top of it?