config.MapODataServiceRoute error
I just had this problem. Very frustrating.
I resolved it by adding this in the references at the top of the code page
using System.Web.OData.Extensions;
Right clicking the method did not bring up the resolve menu item either.
Reinstalling everything did no resolve anything for me.
MapODataServiceRoute is available in Routes Collection, hence below code will do
config.Routes.MapODataServiceRoute("odata", null, GetEdmModel(), new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));
FOR OData V3
- Install Microsoft.AspNet.WebApi.OData
- Add
using System.Web.Http.OData.Builder;
andusing System.Web.Http.OData.Extensions;
- use like
config.Routes.MapODataServiceRoute(...)
FOR OData V4
- Install Microsoft.AspNet.OData
- Add
using System.Web.OData.Builder;
andusing System.Web.OData.Extensions;
- use like
config.MapODataServiceRoute(...)
Dont get stuck on WebApi word, they are both for web api.