Please DO NOT merge. This is only an idea on how to fix the issue. It does NOT compile.
I spent some time digging through the ASP.NET MVC codebase. I noticed that the DefaultControllerFactory made calls to an extension method called HasDirectRouteMatch() and I thought that could be used to find the correct RouteData. Unfortunately GetDirectRouteMatches() still returns multiple RouteData instances, but perhaps you could iterate over each of those instances and call VerifyExpectations()? If one of them comes back without any errors, then that would be the correct route.
The DirectRouteExtensions.cs file is a file I took from the ASP.NET MVC codebase, but with modifications.
I don't know if this is the correct approach, but I did verify that the Verifier class did work against the route GET ~/VerbedAttr but then failed (which was expected) against the route POST ~/VerbedAttr.
Please DO NOT merge. This is only an idea on how to fix the issue. It does NOT compile.
I spent some time digging through the ASP.NET MVC codebase. I noticed that the DefaultControllerFactory made calls to an extension method called
HasDirectRouteMatch()
and I thought that could be used to find the correctRouteData
. UnfortunatelyGetDirectRouteMatches()
still returns multipleRouteData
instances, but perhaps you could iterate over each of those instances and callVerifyExpectations()
? If one of them comes back without any errors, then that would be the correct route.The
DirectRouteExtensions.cs
file is a file I took from the ASP.NET MVC codebase, but with modifications.I don't know if this is the correct approach, but I did verify that the
Verifier
class did work against the routeGET ~/VerbedAttr
but then failed (which was expected) against the routePOST ~/VerbedAttr
.