ODATA过滤器“不包含”操作员

发布于 2025-01-20 04:54:39 字数 231 浏览 4 评论 0原文

我已经尝试查找,但是我无法弄清楚“不包含”操作员的等效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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮年 2025-01-27 04:54:39

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 contain value.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文