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
it mean that when user visit path /amp/zhHans it will access Index.cshtml
the constraints regex will make sure only string "amp" and "zhHans" is available for this route match.
but after i add the config. the odata routing is broke to 404 not found.
if i remove the constraints and change it to options.Conventions.AddPageRoute("/Index", "/amp/zhHans");
odata will work fine. so I suspect this is a bug.
So far, the endpoint Link generator in 7.4 is very naive and only handle the basic template, for example: "abc{temp}". your template /{amp:regex(amp)}/{language:regex(zhHans)} is too complex and so far it's not handled.
Hi xuzhg,
Thank for quick reply. I am not very clear about how odata routing works. My template is for razor page route, why does it affect my odata route?
My understanding is that we have a route list (razor page route + odata route), they will match in order, then even if my razor template route is above the odata routes, but because it will eventually not match due to regex, then in the end my odata route should work properly. Is my understanding wrong?
and any workaround or direction for me?
I spent some time to dig more. and I synced with .NET Core team.
It seems this is an issue in the asp.net core 3x. See dotnet/aspnetcore#20801
I don't have workaround yet, if it's not urgent, please wait for the ship of new .net core 3.x
I m trying to use odata controller and razor page in same application.
my razor page have this config
it mean that when user visit path /amp/zhHans it will access Index.cshtml
the constraints regex will make sure only string "amp" and "zhHans" is available for this route match.
but after i add the config. the odata routing is broke to 404 not found.
if i remove the constraints and change it to
options.Conventions.AddPageRoute("/Index", "/amp/zhHans");
odata will work fine. so I suspect this is a bug.
The package i used is
Reproduce steps
git clone https://github.com/keatkeat87/odata-route-constraint-issue.git
F5 run
visit /odata/WeatherForecast will 404
Expected result
will get odata result.
Actual result
404
The text was updated successfully, but these errors were encountered: