ODATA - 结合$扩展和$选择 [英] odata - combining $expand and $select

查看:179
本文介绍了ODATA - 结合$扩展和$选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ODATA V4.0是有结合$扩大和$一起选择一个选项?


  

我有一个场景,其中我试图让特定列
  productItemChoices和项目。下面的查询会给你所有的
  在productItemChoices列。我只需要在一列
  productItemChoices


<$p$p><$c$c>odata/Products(08f80b45-68a9-4a9f-a516-556e69e6bd58)?$expand=productItemChoices($expand=item($select=name))


解决方案

通过大量的时间在这去后,我终于得到了答案,我们可以选择窝内使用扩展;作为分隔符,像

<$p$p><$c$c>odata/Products(08f80b45-68a9-4a9f-a516-556e69e6bd58)?$expand=productItemChoices($select=anycolumnnameinproductItemChoices;$expand=item($select=name))

In odata v4.0 is there an option for combining $expand and $select together?

I have a scenario wherein I'm trying to get specific columns in productItemChoices and item. The below query will give you all the columns in productItemChoices. I only need one column in the productItemChoices

odata/Products(08f80b45-68a9-4a9f-a516-556e69e6bd58)?$expand=productItemChoices($expand=item($select=name))

解决方案

After going through a lot of time on this, I finally got the answer, we can nest select within expand using ; as a separator, something like

odata/Products(08f80b45-68a9-4a9f-a516-556e69e6bd58)?$expand=productItemChoices($select=anycolumnnameinproductItemChoices;$expand=item($select=name))

这篇关于ODATA - 结合$扩展和$选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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