Note for yourself, when you are registering odata
route in web-api configuration, it must be placed before the default catch-all route. I.e. :
Gloabal.asax.cs
:
protected void Application_Start()
{
// .. do stuff
// This must be before registering all other routes
GlobalConfiguration.Configure(WebApiConfig.Register);
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
// do other stuff...
}
Of you place web-api route registration after MVC route registration, MVC routes will take priority and probably you won’t have OdataController
in your MVC code.
And no, nothing magic about OData there, just standard routes registered in Asp.Net application.