-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.2.651 版本 Where(a=>enumHashSet.Contains(a.xx)) 报错 #1137
Comments
收到问题,IN 不做参数化,是否合理 |
这个只要把HashSet改成List就行。 不过我刚看到还写了个AOP,如果将枚举 MapType 成int fsql.Aop.ConfigEntityProperty += (s, e) =>
{
if (e.Property.PropertyType.IsEnum)
e.ModifyResult.MapType = typeof(int);
}; 如果有AOP时,会有这个异常 ExpressionTree 转换类型错误,值(System.Collections.Generic.List FreeSql/FreeSql/Internal/UtilsExpressionTree.cs Line 2249 in ef42ced
|
确实有这个问题,这个问题反复出现多个版本中,没有彻底解决。 |
@2881099 using FreeSql;
var connStr = "...";
IFreeSql fsql = new FreeSqlBuilder()
.UseConnectionString(DataType.SqlServer, connStr)
.UseGenerateCommandParameterWithLambda(true)
.Build();
var enumerable= new []{ "小明" }.Select(a=>a);
var sql = fsql.Select<User>().Where(a => enumerable.Contains(a.Name)).ToList(a => a);
public class User
{
public string Name { get; set; } = null!;
} 报
|
@tky753 v3.2.661 试下 大的逻辑没改,只是小的 bug 修复可能影响到了这个 |
@2881099 3.2.661试了,Enumerable还是报错,上面的没试 |
确实不支持.ToList下吧
|
新版本已优化 |
问题描述及重现步骤:
从2.6.100升级到3.2.651后,发现以下语句会报错
数据库的具体版本
安装的包
.net framework/. net core? 及具体版本
The text was updated successfully, but these errors were encountered: