是否有可能在扩展实体的集合属性上过滤odata

问题描述 投票:1回答:1

我有一个实体,[Part],具有导航属性[Representation]在实体[Representation]中有一个属性[Files],它是实体文件数组我的问题是:可以在Representation.Files具有filetype='pdf'的零件上进行过滤我尝试过但失败了

  Part?$filter=Representation/any(r:r/Files/filetype eq 'pdf')&$expand=representation

$元数据摘录:

<EntityType Name="Part" BaseType="Entity">
  <NavigationProperty Name="Representations" Type="Collection(Representation)"> </NavigationProperty>
</EntityType>
<EntityType Name="Representation"> 
  <Property Name="AdditionalFiles" Type="Collection(RepresentationHyperlink)"> </Property> 
</EntityType>

注意: Files是具有数组类型的属性,它是not一个navigation属性。

filter odata expand odata-v4
1个回答
0
投票

在OData v4中,以下将起作用:

...Part?$filter=Representation/Files/any(f:f/filetype eq 'pdf')&$expand=representation

any功能在多个导航链接上起作用,因此它应该立即显示在它的后面,而不是它的前面。

© www.soinside.com 2019 - 2024. All rights reserved.