如何将多个参数传递给URL中的微风控制器
-
21-12-2019 - |
题
breezewebapiconfig globalconfiguration.configuration.routes.maphtTproute( 名称:“Breezeapi”, RouteTemplate:“Breeze / {Controller} / {ocction}” );
我有一个微风控制器
[HttpGet]
public IQueryable<Customer> Customers()
{
return _context.Customers;
}
http://hostname:55946/breeze/Breeze/Customers?$filter=Country eq 'USA'
.
工作正常
但是当我将2个过滤条件传递为响亮区时,但查询只执行第一个参数,忽略了第2个参数????
http://hostname:55946/breeze/Breeze/Customers?$filter=Country eq 'USA' && Region eq 10
. 解决方案
odata查询语法使用'和'加入查询条款,因此请尝试:
http://hostname:55946/breeze/Breeze/Customers?$filter=Country eq 'USA' and Region eq 10
. 不隶属于 StackOverflow