for a WebAPI 2 OData solution we need to be able to map the following route-type:
~/odata/1234erp/Products meaning a value prefixes the Controller (or Entityset) segment. Ive got my route set up as follows:
config.Routes.MapODataRoute(
routeName: "odata",
routePrefix: "odata/{tableid}/{controller}",
model: ModelBuilder.GetEdmModel(),
pathHandler: new DefaultODataPathHandler(),
routingConventions: conventions);
This makes the SelectAction method in my CustomControllerRoutingConvention get hit (the SelectController does not get hit) but the odataPath parameter counts 0 segments, where i'd hope it would recognize something like ~/tableid/entityset/
Now i can probably solve this using something like
controllerContext.RequestContext.RouteData.Values["tableid"]
but is there a better (typesafer?) solution for this?
EDIT:
Also, since ODataPath path = Request.GetODataPath()
returns 0 segments, it's no longer possible to derive the EdmType neccessary for ODataQueryOptions...