是否存在关于odata的多级查询



我是odata新手,我想查询多级列表中指定索引的数据。但我没有找到相应的解决方案。这是我的模型。

public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public List<string> Items { get; set; }
}

并且我已经在端点配置了odata。

IEdmModel GetEdmModel()
{
var odataBuilder = new ODataConventionModelBuilder();
odataBuilder.EntitySet<Customer>("Customer");
return odataBuilder.GetEdmModel();
}

如何在列表中显示正确的索引数据

没有这个规则来过滤数据的索引,但是您可以通过top和skip过滤它。Top可以帮助删除以前的索引数据,skip可以删除剩余的索引数据。所以这个规则你可以参考。

https://localhost:44363/odata/Customer?$select=items($top=1;$skip=1)

最新更新