【发布时间】:2016-08-24 09:21:57
【问题描述】:
我正在阅读 Microsoft REST API 指南 (https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md),其中有以美元符号开头的查询参数,例如$orderBy.
9.6 对集合排序
集合查询的结果可以根据属性进行排序 价值观。该属性由 $orderBy 查询的值确定 参数。
现在,如果我尝试在操作方法中定义像 $orderBy 这样的方法参数,那么它在语法上是不正确的($orderBy 不是有效的标识符)。
public class ExampleController : Controller
{
// this is syntactically not correct
public IActionResult Collection(...., string $orderBy = null)
{
...
}
}
如何在 ASP.NET Core 的操作方法中访问以美元符号开头的查询参数?
【问题讨论】:
标签: c# asp.net asp.net-web-api asp.net-core