Need straight-forward example of custom route matching #22551
Unanswered
mitselplik
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I cannot find a straight-forward example of how to implement custom endpoint routing. For example suppose I don't want to use OData, but I like the Uri conventions and I want to write a controller GET method with a template that (it would seem) the current endpoint routing won't allow such as:
I want the Web API service to respond to the Uri
https://localhost:44300/api/TellMeThis(1, 'Foo', 'Bar')
The guys over developing OData are able to accomplish this sort of thing, but I'm going blind trying to study their code and figure out how they are accomplishing route matching and handling the request. So what I would like is a straight-forward example of how to implement the following extension method to plug-in to end-point routing like the guys at OData do with their
MapODataRoutes
extension method, but accomplish it without installing OData:The closest examples I can find to what I am asking for all do something in the neighborhood of:
Doing things this way though seems like it sort of circumvents endpoint routing though. I don't want to reinvent the wheel - only augment it :-)
Beta Was this translation helpful? Give feedback.
All reactions