dotnet / WatsonWebserver

Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
MIT License
406 stars 83 forks source link

- Retrieve last GET value from DynamicRoutes when ? is not used. #28

Closed jurkovic-nikola closed 5 years ago

jurkovic-nikola commented 5 years ago

This is optional feature, since end consumer can parse RawUrl same as here.

jchristn commented 5 years ago

Hi @jurkovic-nikola - thank you for submitting the PR! I generally like the idea but feel it is a bit specific in the way you've implemented it (which is probably exactly what you need for your use case!). One of my goals with Watson is to keep the main implementation of the server and the classes with which a user interacts very generic. If you would be open to it, I think something that would also satisfy this use case that may be more inline with the goals of being generic syntactically would be to have an extension method on HttpRequest.RawUrlEntries. For instance, having a .First() and .Last() extension (such as those provided by System.Linq. Would this satisfy your need? If so I'd love to accept a PR on that. Thanks again, really thankful for your support of the project! ~Joel