mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Exp to sql bug
This commit is contained in:
parent
93f465c96a
commit
53783af1f3
@ -337,7 +337,8 @@ namespace SqlSugar
|
||||
if (this.Context.Result.IsLockCurrentParameter == false)
|
||||
{
|
||||
var expression = ((UnaryExpression)item).Operand as MemberExpression;
|
||||
if (expression.Expression == null)
|
||||
var isDateTimeNow = ((UnaryExpression)item).Operand.ToString() == "DateTime.Now";
|
||||
if (expression.Expression == null&&!isDateTimeNow)
|
||||
{
|
||||
this.Context.Result.CurrentParameter = parameter;
|
||||
this.Context.Result.IsLockCurrentParameter = true;
|
||||
@ -348,7 +349,7 @@ namespace SqlSugar
|
||||
this.Context.Result.Append(this.Context.GetAsString(asName, parameter.CommonTempData.ObjToString()));
|
||||
this.Context.Result.CurrentParameter = null;
|
||||
}
|
||||
else if (expression.Expression is ConstantExpression)
|
||||
else if (expression.Expression is ConstantExpression||isDateTimeNow)
|
||||
{
|
||||
string parameterName = this.Context.SqlParameterKeyWord + "constant" + this.Context.ParameterIndex;
|
||||
this.Context.ParameterIndex++;
|
||||
|
Loading…
Reference in New Issue
Block a user