diff --git a/.vs/SqlSugar/v14/.suo b/.vs/SqlSugar/v14/.suo index 48ab2f14f..c6f541d9a 100644 Binary files a/.vs/SqlSugar/v14/.suo and b/.vs/SqlSugar/v14/.suo differ diff --git a/OrmTest/bin/Debug/OrmTest.exe b/OrmTest/bin/Debug/OrmTest.exe index 935def23b..4898707c3 100644 Binary files a/OrmTest/bin/Debug/OrmTest.exe and b/OrmTest/bin/Debug/OrmTest.exe differ diff --git a/OrmTest/bin/Debug/OrmTest.pdb b/OrmTest/bin/Debug/OrmTest.pdb index 481118b5e..1ed2e1322 100644 Binary files a/OrmTest/bin/Debug/OrmTest.pdb and b/OrmTest/bin/Debug/OrmTest.pdb differ diff --git a/OrmTest/bin/Debug/SqlSugar.dll b/OrmTest/bin/Debug/SqlSugar.dll index a08482425..9c2c79fac 100644 Binary files a/OrmTest/bin/Debug/SqlSugar.dll and b/OrmTest/bin/Debug/SqlSugar.dll differ diff --git a/OrmTest/bin/Debug/SqlSugar.pdb b/OrmTest/bin/Debug/SqlSugar.pdb index e3bda006c..17da62a72 100644 Binary files a/OrmTest/bin/Debug/SqlSugar.pdb and b/OrmTest/bin/Debug/SqlSugar.pdb differ diff --git a/OrmTest/obj/Debug/OrmTest.csprojResolveAssemblyReference.cache b/OrmTest/obj/Debug/OrmTest.csprojResolveAssemblyReference.cache index a3130c082..8b0c5e2e1 100644 Binary files a/OrmTest/obj/Debug/OrmTest.csprojResolveAssemblyReference.cache and b/OrmTest/obj/Debug/OrmTest.csprojResolveAssemblyReference.cache differ diff --git a/OrmTest/obj/Debug/OrmTest.exe b/OrmTest/obj/Debug/OrmTest.exe index 935def23b..4898707c3 100644 Binary files a/OrmTest/obj/Debug/OrmTest.exe and b/OrmTest/obj/Debug/OrmTest.exe differ diff --git a/OrmTest/obj/Debug/OrmTest.pdb b/OrmTest/obj/Debug/OrmTest.pdb index 481118b5e..1ed2e1322 100644 Binary files a/OrmTest/obj/Debug/OrmTest.pdb and b/OrmTest/obj/Debug/OrmTest.pdb differ diff --git a/SqlSugar/ExpressionsToSql/Common/ExpressionParameter.cs b/SqlSugar/ExpressionsToSql/Common/ExpressionParameter.cs index 85e46aa2a..be0e4f5df 100644 --- a/SqlSugar/ExpressionsToSql/Common/ExpressionParameter.cs +++ b/SqlSugar/ExpressionsToSql/Common/ExpressionParameter.cs @@ -16,5 +16,6 @@ namespace SqlSugar public List> BinaryExpressionInfoList { get; set; } public object TempDate { get; set; } public ExpressionParameter BaseParameter { get; set; } + public int SwitchCaseNumber { get; set; } } } diff --git a/SqlSugar/ExpressionsToSql/ResolveItems/NewExpressionResolve.cs b/SqlSugar/ExpressionsToSql/ResolveItems/NewExpressionResolve.cs index f9ee900e5..4daa4f0e3 100644 --- a/SqlSugar/ExpressionsToSql/ResolveItems/NewExpressionResolve.cs +++ b/SqlSugar/ExpressionsToSql/ResolveItems/NewExpressionResolve.cs @@ -41,7 +41,7 @@ namespace SqlSugar foreach (var item in expression.Arguments) { ++i; - if (item.NodeType == ExpressionType.Constant) + if (item.NodeType == ExpressionType.Constant || (item is MemberExpression) && ((MemberExpression)item).Expression.NodeType == ExpressionType.Constant) { base.Expression = item; base.Start(); @@ -52,26 +52,15 @@ namespace SqlSugar else { var memberExpression = (MemberExpression)item; - if (memberExpression.Expression.NodeType.IsIn(ExpressionType.Constant)) + var fieldNme = (memberExpression).Member.Name; + if (isSingle) { - base.Expression = memberExpression; - base.Start(); - string parameterName = this.Context.SqlParameterKeyWord + "constant" + i; - parameter.Context.Result.Append(parameterName); - this.Context.Parameters.Add(new SugarParameter(parameterName, parameter.TempDate)); + parameter.Context.Result.Append(fieldNme); } else { - var fieldNme = (memberExpression).Member.Name; - if (isSingle) - { - parameter.Context.Result.Append(fieldNme); - } - else - { - var shortName = memberExpression.Expression.ToString(); - parameter.Context.Result.Append(shortName + "." + fieldNme); - } + var shortName = memberExpression.Expression.ToString(); + parameter.Context.Result.Append(shortName + "." + fieldNme); } } } @@ -79,3 +68,4 @@ namespace SqlSugar } } } + diff --git a/SqlSugar/bin/Debug/SqlSugar.dll b/SqlSugar/bin/Debug/SqlSugar.dll index a08482425..9c2c79fac 100644 Binary files a/SqlSugar/bin/Debug/SqlSugar.dll and b/SqlSugar/bin/Debug/SqlSugar.dll differ diff --git a/SqlSugar/bin/Debug/SqlSugar.pdb b/SqlSugar/bin/Debug/SqlSugar.pdb index e3bda006c..17da62a72 100644 Binary files a/SqlSugar/bin/Debug/SqlSugar.pdb and b/SqlSugar/bin/Debug/SqlSugar.pdb differ diff --git a/SqlSugar/obj/Debug/SqlSugar.dll b/SqlSugar/obj/Debug/SqlSugar.dll index a08482425..9c2c79fac 100644 Binary files a/SqlSugar/obj/Debug/SqlSugar.dll and b/SqlSugar/obj/Debug/SqlSugar.dll differ diff --git a/SqlSugar/obj/Debug/SqlSugar.pdb b/SqlSugar/obj/Debug/SqlSugar.pdb index e3bda006c..17da62a72 100644 Binary files a/SqlSugar/obj/Debug/SqlSugar.pdb and b/SqlSugar/obj/Debug/SqlSugar.pdb differ