Using a normal ApiController in WebApi, I made the following code to define a dynamic map route template for every ApiControllers:
config.Routes.MapHttpRoute(
name: "Sample",
routeTemplate: "{sessionId}/{controller}"
);
I want to achieve a similar behaviour but for every ODataController. I've tried the following code, but it doesn't work:
config.MapODataServiceRoute(
routeName: "HSODataRoute",
routePrefix: "{sessionId}/",
model: GetEdmModel());
Any idea how this is made in OData? I'm kinda new to it and the internet is lack of information about this.
To be more specific: {sessionId} isn't supposed to be a constant, but a parameter with a Guid value.