c# - 带有 where 和 sum 的 Odata
问题描述
我正在开发 asp.Net-Core 应用程序。我需要发出转换为 SQL 的 ODATA 请求:
SELECT SUM(GameCount)
FROM [GameReportDaily]
where [StartTimeUtc]>'2019-05-13 22:00:00.0000000'
我可以提出要求
/odata/GameReportDaily?$apply=aggregate(gameCount%20with%20sum%20as%20Total)
没有过滤器,它工作正常。现在我需要添加过滤器,但它不起作用:
/odata/GameReportDaily?$apply=aggregate(gameCount%20with%20sum%20as%20Total1)&$filter=(StartTimeUtc+ge+2019-05-27T18%3A00%3A00.000Z)+and+(StartTimeUtc+le+2019-05-28T18%3A00%3A00.000Z)
回复:
"Message": "在 URI 中指定的查询无效。属性或路径 StartTimeUtc 在当前上下文中不可用。它在早期的转换中被删除。",
我怎样才能像上面的 SQL 一样发出 ODATA 请求?
解决方案
推荐阅读
- arrays - SwiftUI:数组内的修饰符
- c++ - g++ 为 transform() 的参数生成错误
- objective-c - 文本字段验证方法 obj c
- jquery - 像谷歌驱动器那样异步下载文件
- google-api - 当我向 googleapis 发出请求时,收到 400 Bad Request
- git - 纱线 v2 gitignore
- c++ - 内存栅栏是否涉及内核
- python - “min(X(X>0), Y, Z)”在 Python 中是什么意思?
- sockets - 如何在 arm Linux 目标上禁用 IPv4 并仅启用 IPv6?
- performance - 我可以使用 Prometheus 监控多个服务器吗?