You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started using Hyperlinkr just a week or so ago, not long after I started working with Web Api 2.
I came across what looks like an issue to me, but it could also be that my expectation is wrong.
So, my problem is that while processing a request with a single Id parameter I try to get a link to a parameterless resource served by another controller and the resulting link includes the Id of the current request.
I see that the very same behaviour is exhibited by the HomeController in ExampleService.
E.g. the response for http://localhost:6788/custom/route/5 is
The second "href" value "http://localhost:6788/home/5" corresponds to the expression Href = this.linker.GetUri<HomeController>(r => r.Get()).ToString().
I cannot see why it should end with /5.
Am I missing something?
Thanks,
Roman.
The text was updated successfully, but these errors were encountered:
Thank you for writing. That does, indeed, look like a bug. In fact, it looks like a bug in ASP.NET Web API, because if you change the ExampleServiceHomeController.Get(string) to create the second link like the following, you still see the same behaviour:
I haven't checked whether it's an issue with the new ASP.NET Core framework, but it seems to be an issue at least with the version of ASP.NET Web API used by ExampleService.
I've started using Hyperlinkr just a week or so ago, not long after I started working with Web Api 2.
I came across what looks like an issue to me, but it could also be that my expectation is wrong.
So, my problem is that while processing a request with a single Id parameter I try to get a link to a parameterless resource served by another controller and the resulting link includes the Id of the current request.
I see that the very same behaviour is exhibited by the
HomeController
in ExampleService.E.g. the response for http://localhost:6788/custom/route/5 is
The second "href" value
"http://localhost:6788/home/5"
corresponds to the expressionHref = this.linker.GetUri<HomeController>(r => r.Get()).ToString()
.I cannot see why it should end with
/5
.Am I missing something?
Thanks,
Roman.
The text was updated successfully, but these errors were encountered: