Odata V4 按顶部分组并跳过不起作用

Odata V4 group by with Top and skip not working

我无法让 groupby 与 top 和 skip 一起工作,这应该是最简单的事情。 我正在使用 OData 获取数据并能够使用下面的查询获取输出

https://localhost:6523/api/OData/AssetUsage/?$apply=groupby((assetId,BIAsset/name),aggregate(交互总和为totalInteractions, uniqueInteractions 总和为totalUniqueInteractions))&$orderBy=totalInteractions asc

Output of the above query

然而,当我尝试在上面生成的输出上应用 skip 或 top 时,我收到下面提到的错误

https://localhost:6523/api/OData/AssetUsage/?$apply=groupby((assetId,BIAsset/name),aggregate(交互总和为totalInteractions, uniqueInteractions 总和为totalUniqueInteractions))&$orderBy=totalInteractions asc&$top= 1

错误 -

实体class结构

public class AssetUsage
{
    public int Id { get; set; }
    [ForeignKey("BIAsset")]
    public int? AssetId { get; set; }
    public int YearMonthId { get; set; }
    public int Interactions { get; set; }
    public int UniqueInteractions { get; set; }
    public DateTimeOffset Recency { get; set; }
    public virtual BIAsset BIAsset { get; set; }

}

我使用的是 EnableLowerCamelCase(),所以我需要在编写查询时使用精确的大小写。 但是在未来的更新中,这个问题将得到解决。 请参阅下面 URL 以获取更多更新。 https://github.com/OData/WebApi/issues/1659