来自odata.org的可写OData V2服务:从扩展实体看不到 [英] Writable OData V2 service from odata.org: "Products" from an expanded Entity not visible

查看:110
本文介绍了来自odata.org的可写OData V2服务:从扩展实体看不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用此可写的 OData v2示例服务(不是Northwind),我将单个 Category 实体绑定到容器控件,同时扩展到实体集 Products .在容器控件的内部,我有一个列表,该列表具有一个聚合项,这些项绑定到具有来自扩展的产品的项目.

Using this writable OData v2 sample service (not Northwind), I'm binding a single Category entity to a container control while expanding to the entity set Products. Inside the container control, I have a list which has an aggregation binding to the items with the products coming from the expand.

<Page binding="{
  path: 'odataModel>/Categories(1)',
  parameters: {
    expand: 'Products'
  }
}">
  <List items="{odataModel>Products}">
    <StandardListItem title="{odataModel>Name}" />
  </List>
</Page>

问题是,尽管我得到了正确的收藏长度,但列表没有显示产品名称.而且也没有错误消息.

The problem is that the list doesn't show the names of the products, although I get the correct length of the collection. And there are no error messages either.

以下是实现示例OData服务的示例:

Here is the example implementing the sample OData service: https://embed.plnkr.co/bC2KPe/.

奇怪的是,每个项目的绑定路径都报告为"/[object Object]"而不是类似"/Products(1)"之类的东西.

Weirdly, the binding path of each item is reported as "/[object Object]" instead of something like "/Products(1)".

如果 ...

The properties of the products are visible if...

  • I do the same with the Northwind service instead, which is readable only (But what I need is a writable service)
  • I bind the products directly to the list without the parent's element binding.
  • I delete a single product (e.g. manually "/Products(0)" as it can be seen in the plunker example). After that, the product names are visible.

此示例服务有什么问题?我是否必须根据该服务专门配置ODataModel?仅仅是服务无法正常工作吗?

What's wrong with this sample service? Do I have to configure my ODataModel according to that service specifically? Is it just the service that is not working properly?

我还想用其他实体集替换 Products ,但是所有其他实体集( Suppliers Categories )导航到仅产品.

Also I wanted to replace Products with a different entity set but all the other entity sets (Suppliers and Categories) navigate to Products only.

还有其他我可以测试的免费可写样本OData V2服务吗?

Is there any other free writable sample OData V2 service I can test?

推荐答案

我看到odata.svc上的结果结构与服务中的预期不符.结果结构缺少结果"参数. 如果您看到罗斯文服务,则它具有结果"参数.

I see that the resulting structure on odata.svc is not as expected in the service. The resulting structure is missing the 'results' parameter. If you see the northwind service, it has the 'results' parameter.

这篇关于来自odata.org的可写OData V2服务:从扩展实体看不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆