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

Add Auto route feature and Test.AutoRoute example. #47

Closed asuradoll closed 3 years ago

asuradoll commented 3 years ago

Add Auto route feature and Test.AutoRoute example.

Signed-off-by: asuradoll asuradoll@163.com

jchristn commented 3 years ago

Hi @asuradoll oddly enough I was just in the midst of finishing a new version that adds route attributes for each type of route and automatically loading them. I appreciate the PR! I'll use it as a guide and make sure you get the proper credit.

jchristn commented 3 years ago

Just reviewed in more detail and it seems you've done something slightly different than what I was doing. I'll be finalizing v3.3 today and will publish, then will look into a merge. Love the way you've embedded your route methods into a separate class and used an attribute with a base path.

jchristn commented 3 years ago

Hi @asuradoll can this be amended to use the StaticRouteAttribute and DynamicRouteAttribute attributes and integrated into the ReflectionCore.LoadRoutes method?