0

I'm working on a backbone.js app that GET the odata format from the controller:

  public IQueryable<ContactList> Get()
  {
     return dbContext.ContactsList.AsQueryable();
  }

But the way I receive the data is in the following format

odata.count: "15504"
odata.metadata: "http://localhost:53341/odata/$metadata#Prescribers"
odata.nextLink: "http://localhost:53341/odata/Prescribers?$inlinecount=allpages&$format=application%2Fjson%3Bodata%3Dverbose
value: [,…]

Note the $format. Despite setting this up, it keeps sending me data in odata v3 format. I also tested it in Fiddler, but still the same result.

Am I doing something wrong? I'm trying to use the data for Backbone paginator https://github.com/backbone-paginator/backbone.paginator

user1828605
  • 1,723
  • 1
  • 24
  • 63

1 Answers1

0

I don't think webapi.odata v3 supports $format.

But you can try setting the accept header with application/json;...

If you want to use $format in the url, you can call "AddQueryStringMapping" to map $format, check this:

http://www.c-sharpcorner.com/UploadFile/2b481f/odata-feed-using-Asp-Net-web-api/

Feng Zhao
  • 2,977
  • 1
  • 14
  • 20