Question

In the Upshot.js library, that is part of the http://www.asp.net/single-page-application feature of ASP.NET MVC 4 Beta, how can it be configured to work with an OData service developed with WCF Data Services?

The source code contains a "upshot.ODataDataProvider"; how can it be used?

Was it helpful?

Solution

I have a sample project here that you can check out which has a working OData test: https://github.com/Marcus-L/Test-Upshot

Here's a code snippet:

upshot.dataSources = upshot.dataSources || {};
upshot.dataSources.ParentThings = upshot.RemoteDataSource({
  provider: upshot.ODataDataProvider,
  providerParameters: { url: "/OData.svc", operationName: "ParentThings", operationParameters: { $expand: "Children"} },
  bufferChanges: true,
  dataContext: undefined,
  mapping: {}
});
upshot.dataSources.ParentThings.refresh();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top