我想通过odata传递id的列表来加载项目。例如,我应该这样做来加载id为1的项目:
GET http://localhost:9001/DefaultBatch/DefaultBatchCustomer(1) HTTP/1.1
现在我想做类似的事情来加载id为1和2的项目:
GET http://localhost:9001/DefaultBatch/DefaultBatchCustomer(1,2) HTTP/1.1
有可能吗?我在文档中找不到任何信息
要通过多个ID进行过滤,您必须使用$filter
子句:
GET http://localhost:9001/DefaultBatch/DefaultBatchCustomer?$filter=id eq 1 or id eq 2
OData URI conventions /逻辑运算符段落