|
|
@ -5,11 +5,28 @@ using System.Linq.Expressions; |
|
|
|
using System.Text; |
|
|
|
namespace SqlSugar |
|
|
|
{ |
|
|
|
public class ConstantExpressionResolve:BaseResolve |
|
|
|
public class ConstantExpressionResolve : BaseResolve |
|
|
|
{ |
|
|
|
public ConstantExpressionResolve(ExpressionParameter parameter) : base(parameter) |
|
|
|
{ |
|
|
|
|
|
|
|
var expression = base.Expression as MemberExpression; |
|
|
|
var isLeft = parameter.IsLeft; |
|
|
|
var isSingle = parameter.Context.IsSingle; |
|
|
|
string value = string.Empty; |
|
|
|
if (parameter.BaseParameter.BinaryExpressionInfoList != null) |
|
|
|
{ |
|
|
|
parameter.BaseParameter.BinaryExpressionInfoList.Add(new KeyValuePair<string, BinaryExpressionInfo>(ExpressionConst.BinaryExpressionInfoListKey, new BinaryExpressionInfo() |
|
|
|
{ |
|
|
|
IsLeft = Convert.ToBoolean(IsLeft), |
|
|
|
Value = value, |
|
|
|
ExpressionType = expression.GetType() |
|
|
|
})); |
|
|
|
} |
|
|
|
if (isLeft == null && base.SqlWhere == null) |
|
|
|
{ |
|
|
|
base.SqlWhere = new StringBuilder(); |
|
|
|
base.SqlWhere.Append(value); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|