在MVC6中使用WebApi自动过滤参数

时间:2016-02-04 11:27:09

标签: .net asp.net-web-api2 asp.net-core-mvc

我正在关注本教程http://aspnetmvc.readthedocs.org/projects/mvc/en/latest/getting-started/first-web-api.html,并想知道WebApi是否可以提供通用过滤器。例如,这可以工作:http://localhost:11979/api/todo?IsComplete=true而不必为每个模型实现单独的过滤器。

框架能否自动识别模型中存在的过滤字段并进行相应的查询?

0 个答案:

没有答案