microsoft-dynamics - 计数从 Dynamics 365 Web API 中的 $extend 返回的记录
问题描述
基本上,我有这样的事情:
https://company.crm.dynamics.com/api/data/v9.0/accounts?$select=accountid,accountnumber,name&$expand=crm_productbuyer($select=name)
我希望能够只计算返回的记录数,$expand
而不是在 C# 中对其进行反序列化并对其进行计数。少一件事需要迭代。
这对我的情况不起作用:
编辑:
这里有很多事情表明这是不可行的:
您不能使用 /$ref 或 /$count 路径段仅返回相关实体的 URI 或相关实体的数量。
这是 OData 版本 4.0 第 1 部分的“11.2.4.2.1 扩展选项”部分中描述的系统查询选项的子集:协议加勘误表 02。选项 $skip、$count、$search、$expand 和 $levels Web API 不支持。
除非其他人插话来证明,否则会将其标记为答案。
解决方案
听起来不可行:
您不能使用 /$ref 或 /$count 路径段仅返回相关实体的 URI 或相关实体的数量。
这是 OData 版本 4.0 第 1 部分的“11.2.4.2.1 扩展选项”部分中描述的系统查询选项的子集:协议加勘误表 02。选项 $skip、$count、$search、$expand 和 $levels Web API 不支持。
推荐阅读
- java - 如何在java中找到实现接口的所有子类?
- mule - 我可以在不重启 Mule 的情况下重启 ActiveMQ 吗?
- excel - Trim 函数和 WorksheetFunction.Trim 不会删除前导或尾随空格
- python - 在破折号中,选择单个单选按钮时,如何使用回调更新图形?
- python - 线性回归模型(使用梯度下降)不收敛于波士顿住房数据集
- reverse-proxy - Firebase 托管是否需要反向代理?
- c - 如何像 Linux 命令 ls 一样格式化输出以打印
- html - 如何在横幅上显示文本叠加图像
- r - 在不知道变量名称的情况下将数据框重塑为三列宽
- php - 创建一个目录,将另一个目录的文件复制到其中,然后在 phpMyAdmin 中创建一个表?