Entity Framework (EF) Core 2.0 中的 SqlFunctions
等效项是什么?
我正在尝试将其转换为 EF Core
private static readonly MethodInfo StringConvertMethodDouble = typeof(SqlFunctions).GetMethod("StringConvert", new Type[] { typeof(double?) });
编辑#1: 我应该指定我正在使用表达式树生成动态 linq 查询来查询数据库
谢谢
最佳答案
EF Core 通过 EF.Functions
提供函数,但在 2.0 中仅 Like
可用:
ctx.TestEntities.Any(entity => EF.Functions.Like(entity.Name, "%foo%"))
关于c# - EF Core 中 SqlFunctions 的等效项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48897454/