Question

I've written an OData service and have a requirement for versioning using controller directories, for example:

Controllers
 - v1
   - StaffController
 - v2
   - StaffController

I want to type in the uri odata/v1/Staff for version 1 users or odata/v2/Staff for version 2 users.

I've tried implementing my own IHttpControllerSelector and modifying the MapHttpRoute in WebApiConfig but that didn't work out so well.

Would you be able to tell me if I'm going in the right direction and point me to a code sample? Or maybe there's a better way to create versions?

Thanks in advance!

Was it helpful?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top