ODATA过滤器“不包含”操作员
我已经尝试查找,但是我无法弄清楚“不包含”操作员的等效odata滤波器字符串是什么。这就是我为“包含”操作员所做的:
case FilterOperator.Contains:
odataFilter = $"contains({queryFilter.FieldName}, '{value}')";
break;
I have tried finding but I am unable to figure out what the equivalent OData filter string would be for the "Does not contain" operator. This is what I did for the "Contains" operator:
case FilterOperator.Contains:
odataFilter = quot;contains({queryFilter.FieldName}, '{value}')";
break;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
odataFilter = $"indexof({queryFilter.FieldName}, '{value}') eq -1";
这将返回
FieldName
中的值不包含 <代码>值。如果在第一个参数指定的字段中找不到第二个参数中指定的字符串,
indexof
函数将返回 -1。有关详细信息,请参阅技术文档参考:
https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html#_Toc371341777
odataFilter = $"indexof({queryFilter.FieldName}, '{value}') eq -1";
This will returns entities where the value in
FieldName
does not containvalue
.The
indexof
function will return -1 if the specified string in the second parameter could not be found in the field specified in the first parameter.See the reference to the technical documentation for more information:
https://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html#_Toc371341777