mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-05 13:17:57 +08:00
-
This commit is contained in:
parent
c9d9385cd2
commit
c0ff7b1c11
@ -5,7 +5,7 @@ using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
internal class ExpConst
|
||||
internal class ExpressionConst
|
||||
{
|
||||
public const string BinaryExpressionInfoListKey = "BinaryExpressionInfoListKey";
|
||||
public const string BinaryFormatString = " ( {0} {1} {2} ) ";
|
||||
@ -26,7 +26,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return ExpConst.GetThrowMessage("拉姆达解析出错:不支持{0}此种运算符查找!",
|
||||
return ExpressionConst.GetThrowMessage("拉姆达解析出错:不支持{0}此种运算符查找!",
|
||||
"Lambda parsing error: {0} does not support the operator to find!");
|
||||
}
|
||||
}
|
||||
@ -34,7 +34,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return ExpConst.GetThrowMessage("Expression format error, correct format: it=>it.fieldName",
|
||||
return ExpressionConst.GetThrowMessage("Expression format error, correct format: it=>it.fieldName",
|
||||
"表达示格式错误,正确格式: it=>it.fieldName");
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class ExpTool
|
||||
public class ExpressionTool
|
||||
{
|
||||
public static string GetOperator(ExpressionType expressiontype)
|
||||
{
|
@ -11,7 +11,7 @@ namespace SqlSugar
|
||||
{
|
||||
parameter.BinaryExpressionInfoList =new List<KeyValuePair<string, BinaryExpressionInfo>>();
|
||||
var expression = this.Expression as BinaryExpression;
|
||||
var operatorValue = ExpTool.GetOperator(expression.NodeType);
|
||||
var operatorValue = ExpressionTool.GetOperator(expression.NodeType);
|
||||
var isComparisonOperator =
|
||||
expression.NodeType != ExpressionType.And &&
|
||||
expression.NodeType != ExpressionType.AndAlso &&
|
||||
@ -27,22 +27,22 @@ namespace SqlSugar
|
||||
base.IsLeft = null;
|
||||
string leftString = GetLeftString(parameter);
|
||||
string rightString = GetRightString(parameter);
|
||||
string binarySql =string.Format(ExpConst.BinaryFormatString,leftString,operatorValue,rightString);
|
||||
string binarySql =string.Format(ExpressionConst.BinaryFormatString,leftString,operatorValue,rightString);
|
||||
string sqlWhereString = base.SqlWhere.ToString();
|
||||
if (base.SqlWhere == null) {
|
||||
base.SqlWhere = new StringBuilder();
|
||||
}
|
||||
if (sqlWhereString.Contains(ExpConst.Format0))
|
||||
if (sqlWhereString.Contains(ExpressionConst.Format0))
|
||||
{
|
||||
base.SqlWhere.Replace(ExpConst.Format0, sqlWhereString);
|
||||
base.SqlWhere.Replace(ExpressionConst.Format0, sqlWhereString);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.SqlWhere.Append(binarySql);
|
||||
}
|
||||
if (sqlWhereString.Contains(ExpConst.Format1))
|
||||
if (sqlWhereString.Contains(ExpressionConst.Format1))
|
||||
{
|
||||
base.SqlWhere.Replace(ExpConst.Format1, ExpConst.Format0);
|
||||
base.SqlWhere.Replace(ExpressionConst.Format1, ExpressionConst.Format0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace SqlSugar
|
||||
var isSingle = parameter.Context.IsSingle;
|
||||
string fieldName = string.Empty;
|
||||
fieldName = isSingle ? expression.Member.Name : expression.Member.ToString();
|
||||
parameter.BaseParameter.BinaryExpressionInfoList.Add(new KeyValuePair<string, BinaryExpressionInfo>(ExpConst.BinaryExpressionInfoListKey, new BinaryExpressionInfo()
|
||||
parameter.BaseParameter.BinaryExpressionInfoList.Add(new KeyValuePair<string, BinaryExpressionInfo>(ExpressionConst.BinaryExpressionInfoListKey, new BinaryExpressionInfo()
|
||||
{
|
||||
IsLeft = Convert.ToBoolean(IsLeft),
|
||||
Value = fieldName,
|
||||
|
@ -109,7 +109,7 @@
|
||||
<Compile Include="Enum\JoinType.cs" />
|
||||
<Compile Include="Enum\OrderByType.cs" />
|
||||
<Compile Include="ExpressionsToSql\ResolveExpressType.cs" />
|
||||
<Compile Include="ExpressionsToSql\ExpConst.cs" />
|
||||
<Compile Include="ExpressionsToSql\ExpressionConst.cs" />
|
||||
<Compile Include="ExpressionsToSql\ResolveItems\BaseResolve.cs" />
|
||||
<Compile Include="ExpressionsToSql\ResolveItems\BinaryExpressionResolve.cs" />
|
||||
<Compile Include="ExpressionsToSql\ResolveItems\BlockExpressionResolve.cs" />
|
||||
@ -121,7 +121,7 @@
|
||||
<Compile Include="ExpressionsToSql\ResolveItems\UnaryExpressionResolve.cs" />
|
||||
<Compile Include="ExpressionsToSql\ExpResolveAccessory.cs" />
|
||||
<Compile Include="ExpressionsToSql\ExpressionContext.cs" />
|
||||
<Compile Include="ExpressionsToSql\ExpTool.cs" />
|
||||
<Compile Include="ExpressionsToSql\ExpressionTool.cs" />
|
||||
<Compile Include="InstanceFactory.cs" />
|
||||
<Compile Include="Interface\ICodeFirst.cs" />
|
||||
<Compile Include="Interface\IDb.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user