aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

Support receiver name / id lookup in `ActionDescriptor` passed to constraints #250

Closed dougbu closed 6 years ago

dougbu commented 6 years ago

To support frameworks built on top of ASP.NET Core WebHooks, make WebHook constraints aware of ActionDescriptor.RouteValues. This will enable higher-level frameworks to use route templates lacking {webHookReceiver} and {id?} parameter route values.

Suggest preferring RouteData.Values i.e. use WebHookRouteDataExtensions.TryGetWebHookReceiverName(...) and TryGetWebHookReceiverId(...) first. Fall back to ActionDescriptor.RouteValues.

(This extension is not necessary in WebHook filters because ActionDescriptor.RouteValues are added to RouteData.Values after the route is chosen.)

dougbu commented 6 years ago

~~390ebbb258 in release/2.1 1aeaf69f87 merges this to dev~~

dougbu commented 6 years ago

Ignore last comment

dougbu commented 6 years ago

e4163deb1d in release/2.1 7545b61534 to merge this into dev