Open gathogojr opened 9 months ago
@gathogojr have you guys every discussed the possibility of deprecating conventional routing for OData in favor of explicit attribute routing?
I might've asked this somewhere else before (if so, my apologies), but conventional routing existing alongside attribute routing has brought so many issues it's crazy. It is also fairly confusing to a lot of people how they play together, and usually most people will end up with multiple duplicate routes because both mechanisms are always on.
If I could vote on this, I think conventional routing should be deprecated eventually.
We currently support the following routes conventionally via the
PropertyRoutingConvention
:{entityset}({key})/{structuralproperty}/{cast}
or{entityset}/{key}/{structuralproperty}/{cast}
{singleton}/{structuralproperty}/{cast}
Where,
structuralproperty
can be single-valued or collection-valuedGet{structuralproperty}Of{cast}
However, we DON'T support the following routes conventionally via the
NavigationRoutingConvention
:{entityset}({key})/{navigationproperty}/{cast}
or{singleton}/{key}/{navigationproperty}/{cast}
{singleton}/{navigationproperty}/{cast}
Where,
navigationproperty
can be single-valued or collection-valuedI can't think of any reason why we would support a cast segment after a structural property conventionally and not support for navigation property.
Assemblies affected
Reproduce steps
Create a simple repro project with the characteristics described above:
Expected result
The following routes to be supported conventionally:
{entityset}({key})/{navigationproperty}/{cast}
/{singleton}/{key}/{navigationproperty}/{cast}
{singleton}/{navigationproperty}/{cast}
Actual result
The following routes are not conventionally supported:
{entityset}({key})/{navigationproperty}/{cast}
/{singleton}/{key}/{navigationproperty}/{cast}
{singleton}/{navigationproperty}/{cast}
Additional detail
Workaround is to use attribute routing, e.g.: