Before adding OData to my project, my routes where set up like this:
config.Routes.MapHttpRoute(
name: \"ApiById\",
routeTempl
Set routePrefix to "api".
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet("CustomerType");
config.MapODataServiceRoute(routeName: "ODataRoute", routePrefix: "api", model: builder.GetEdmModel());
Which OData version are you using? Check for correct namespaces, for OData V4 use System.Web.OData
, for V3 System.Web.Http.OData
. Namespaces used in controllers have to be consistent with the ones used in WebApiConfig.