mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 20:27:56 +08:00
-
This commit is contained in:
parent
07a60b5b14
commit
48630e4b6e
Binary file not shown.
@ -25,7 +25,7 @@ namespace OrmTest
|
||||
string x = "1";
|
||||
Expression<Func<Student, bool>> exp = it => it.Name==new Program().x;
|
||||
// Expression<Func<Student, object>> exp = it => it.Name;
|
||||
ExpressionContext expContext = new ExpressionContext(exp, ResolveExpressType.Single);
|
||||
ExpressionContext expContext = new ExpressionContext(exp, ResolveExpressType.WhereSingle);
|
||||
// var x = expContext.GetFiledName();
|
||||
var xx = expContext.ToSqlString();
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -86,7 +86,7 @@ namespace SqlSugar
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Type == ResolveExpressType.Multiple)
|
||||
if (Type == ResolveExpressType.WhereMultiple)
|
||||
{
|
||||
type = MemberType.Key;
|
||||
var dbName = exp.ToString();
|
||||
|
@ -39,7 +39,7 @@ namespace SqlSugar
|
||||
}
|
||||
|
||||
public string SqlWhere = null;
|
||||
public ResolveExpressType Type = ResolveExpressType.Single;
|
||||
public ResolveExpressType Type = ResolveExpressType.WhereSingle;
|
||||
public List<SqlParameter> Paras = new List<SqlParameter>();
|
||||
private int SameIndex = 1;
|
||||
private SqlSugarClient DB;
|
||||
@ -272,7 +272,7 @@ namespace SqlSugar
|
||||
string oldLeft = left;
|
||||
left = left + SameIndex;
|
||||
SameIndex++;
|
||||
if (Type != ResolveExpressType.Single)
|
||||
if (Type != ResolveExpressType.WhereSingle)
|
||||
{
|
||||
left = left.Replace(".", "_");
|
||||
}
|
||||
@ -298,7 +298,7 @@ namespace SqlSugar
|
||||
string oldRight = right;
|
||||
right = right + SameIndex;
|
||||
SameIndex++;
|
||||
if (Type != ResolveExpressType.Single)
|
||||
if (Type != ResolveExpressType.WhereSingle)
|
||||
{
|
||||
right = right.Replace(".", "_");
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace SqlSugar
|
||||
|
||||
public virtual ISugarQueryable<T> Where(Expression<Func<T, bool>> expression)
|
||||
{
|
||||
base.Where<T>(expression, ResolveExpressType.Single, this.Context);
|
||||
base.Where<T>(expression, ResolveExpressType.WhereSingle, this.Context);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ namespace SqlSugar
|
||||
var sqlBuilder = this.Context.SqlBuilder;
|
||||
var items = sqlBuilder.LambadaQueryBuilder;
|
||||
items.WhereIndex = items.WhereIndex + 100;
|
||||
items.ResolveType = ResolveExpressType.Multiple;
|
||||
items.ResolveType = ResolveExpressType.WhereMultiple;
|
||||
ResolveExpress re = new ResolveExpress();
|
||||
re.Context = this.Context;
|
||||
var exLeftArray = re.GetLeftArray(expression);
|
||||
|
@ -7,7 +7,9 @@ namespace SqlSugar
|
||||
{
|
||||
public enum ResolveExpressType
|
||||
{
|
||||
Single = 0,
|
||||
Multiple = 1,
|
||||
WhereSingle = 0,
|
||||
WhereMultiple = 1,
|
||||
SelectSingle=2,
|
||||
SelectMultiple=3
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Type == ResolveExpressType.Single;
|
||||
return this.Type == ResolveExpressType.WhereSingle;
|
||||
}
|
||||
}
|
||||
public List<SugarParameter> Parameters
|
||||
|
@ -19,7 +19,7 @@ namespace SqlSugar
|
||||
var isProperty = expression.Member is System.Reflection.PropertyInfo;
|
||||
if (isField)
|
||||
{
|
||||
value = ExpressionTool.GetFiledValue(expression.Expression as MemberExpression);
|
||||
value = ExpressionTool.GetFiledValue(expression);
|
||||
}
|
||||
else if (isProperty)
|
||||
{
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user