5

在 Upshot.js 库中,这是 ASP.NET MVC 4 Beta 的http://www.asp.net/single-page-application功能的一部分,如何将其配置为与使用 WCF 开发的 OData 服务一起使用数据服务?

源代码包含一个“upshot.ODataDataProvider”;怎么用?

4

1 回答 1

1

我在这里有一个示例项目,您可以查看其中有一个有效的 OData 测试:https ://github.com/Marcus-L/Test-Upshot

这是一个代码片段:

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();
于 2012-03-25T18:20:41.327 回答