This allows us to filter `IEndpointSelectorPolicy` instance based on
whether the apply to a given candidate set. This should allow us to
remove some HAXXX from MVC.
The idea here is the ESP becomes much more pay-for-play if you can
statically eliminate many of the cases where it would usually no op.
Adds logging for the most common things that can prevent an endpoint
from matching.
Note that we already have good logging in other parts of the system, the
stuff here completes the story by providing details at the debug level.
- Rename -> IOutboundParameterTransformer
- Make it operate on object
- Implementing caching for constraints/tranformers for link generation
(cached as part of TemplateBinder)
These changes are based on our discussion earlier this week. Adding
async, and making it possible to short circuit, which should be better
aligned with the requirments of versioning.
Implement EndpointSelector and MatcherPolicy
This change makes the EndpointSelector API more concrete, and is the
beggining of removing EndpointConstraint by making it obsolete.
To that end, I'm introducing MatcherPolicy, which is a
feature-collection API for registering policies that interact with the
DfaMatcher. The two policies that we'll need to start are:
- ability to order endpoints
- ability to append 'policy' nodes to the graph
These two concepts together replace EndpointConstraint. Extending our
graph representation is a really efficient way to processing most common
scenarios.
---
In general this helps with common cases where 4 or so endpoints match
the URL, but with different HTTP methods supported on each. Today we
have to process route values and call into some 'policy' to make a
decision about which one is the winner. This change pushes this
knowledge down into the graph so that it's roughly as cheap as a
dictionary lookup, and can be done allocation-free.
The big savings here is ability to remove more candidates *before*
collecting route data.
---
Along with this change, I also built 'rejection' into the DFA node
model, you can see an example with the HTTP Method handling that I
implemented. I implemented a policy that can treat failure to resolve an
HTTP method as a 405 response by returning a failure endpoint. This is
at the heart of much of the feedback we've gotten in this area around
versioning and http method handling. We also have a version of this
feature in MVC for [Consumes].