c# - 为什么不建议在 EF Core 中使用带参数的 Compare() 方法?
问题描述
为什么不建议在 EF Core 中使用带参数的 Compare() 方法(例如 StringComparison.OrdinalIgnoreCase)?
我试过这样的实现:
var searchString = "abc";
var result = items.Where(t => t.Name.ToString().Contains(searchString, StringComparison.OrdinalIgnoreCase);
items
这里是 IQueryable
实际上这段代码有效,但我不确定它是否没有任何陷阱。明天我将提供它如何在 SQL 端执行的分析结果。
解决方案
推荐阅读
- django - X-Accel-Redirect Nginx 配置不起作用
- server - 虚拟机 VS 虚拟服务器
- python - Python:我如何得到背景图像 url 值
- angular - ng-multiselect-dropdown - TypeError:无法读取未定义的属性“idField”
- php - PHP 加速器不适用于 Symfony
- mvvm - 模板 10 是否实现 INotifyPropertyChanged?
- r - 如何更改 4 X 4 图形面板中图之间的距离?
- php - 对单个关联数组的所有元素进行排序
- python - 如何使用 Python 从 dic 中提取某些值
- java - 如何处理和访问ArrayList的ArrayList的ArrayList的元素