Update core

This commit is contained in:
SUNKAIXUAN
2021-03-11 22:51:35 +08:00
parent 73b66d99ee
commit be219e10f4
5 changed files with 16 additions and 0 deletions

View File

@@ -238,6 +238,7 @@ namespace SqlSugar
{ {
resolveExpress.PgSqlIsAutoToLower = true; resolveExpress.PgSqlIsAutoToLower = true;
} }
resolveExpress.RootExpression = expression;
resolveExpress.JoinQueryInfos = Builder.QueryBuilder.JoinQueryInfos; resolveExpress.JoinQueryInfos = Builder.QueryBuilder.JoinQueryInfos;
resolveExpress.IsSingle = IsSingle(); resolveExpress.IsSingle = IsSingle();
resolveExpress.MappingColumns = Context.MappingColumns; resolveExpress.MappingColumns = Context.MappingColumns;

View File

@@ -45,6 +45,7 @@ namespace SqlSugar
public IgnoreColumnList IgnoreComumnList { get; set; } public IgnoreColumnList IgnoreComumnList { get; set; }
public bool PgSqlIsAutoToLower { get; set; } public bool PgSqlIsAutoToLower { get; set; }
public List<SqlFuncExternal> SqlFuncServices { get; set; } public List<SqlFuncExternal> SqlFuncServices { get; set; }
public Expression RootExpression { get; set; }
public bool IsSingle public bool IsSingle
{ {
get get
@@ -129,6 +130,7 @@ namespace SqlSugar
copyContext.ParameterIndex = this.ParameterIndex; copyContext.ParameterIndex = this.ParameterIndex;
copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower; copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower;
copyContext.IsSingle = this.IsSingle; copyContext.IsSingle = this.IsSingle;
copyContext.RootExpression = this.RootExpression;
return copyContext; return copyContext;
} }
public ExpressionContext GetCopyContextWithMapping() public ExpressionContext GetCopyContextWithMapping()
@@ -144,6 +146,7 @@ namespace SqlSugar
copyContext.RefreshMapping = this.RefreshMapping; copyContext.RefreshMapping = this.RefreshMapping;
copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower; copyContext.PgSqlIsAutoToLower = this.PgSqlIsAutoToLower;
copyContext.IsSingle = this.IsSingle; copyContext.IsSingle = this.IsSingle;
copyContext.RootExpression = this.RootExpression;
return copyContext; return copyContext;
} }
#endregion #endregion

View File

@@ -63,6 +63,11 @@ namespace SqlSugar
context.SingleTableNameSubqueryShortName = (((meExp.Body as BinaryExpression).Right as MemberExpression).Expression as ParameterExpression).Name; context.SingleTableNameSubqueryShortName = (((meExp.Body as BinaryExpression).Right as MemberExpression).Expression as ParameterExpression).Name;
} }
} }
else if (context.RootExpression!=null&&context.Expression.GetType().Name == "SimpleBinaryExpression")
{
var name = (this.context.RootExpression as LambdaExpression).Parameters[0].Name;
context.SingleTableNameSubqueryShortName = name;
}
else else
{ {
Check.Exception(true, "I'm sorry I can't parse the current expression"); Check.Exception(true, "I'm sorry I can't parse the current expression");

View File

@@ -27,6 +27,7 @@ namespace SqlSugar
Action<Type> InitMappingInfo { get; set; } Action<Type> InitMappingInfo { get; set; }
Action RefreshMapping { get; set; } Action RefreshMapping { get; set; }
bool PgSqlIsAutoToLower { get; set; } bool PgSqlIsAutoToLower { get; set; }
Expression RootExpression { get; set; }
string GetAsString(string fieldName, string fieldValue); string GetAsString(string fieldName, string fieldValue);
void Resolve(Expression expression, ResolveExpressType resolveType); void Resolve(Expression expression, ResolveExpressType resolveType);

View File

@@ -392,6 +392,12 @@ namespace SqlSugar
} }
return true; return true;
} }
public override List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true)
{
tableName = SqlBuilder.GetNoTranslationColumnName(tableName);
var result= base.GetColumnInfosByTableName(tableName, isCache);
return result;
}
public override bool RenameColumn(string tableName, string oldColumnName, string newColumnName) public override bool RenameColumn(string tableName, string oldColumnName, string newColumnName)
{ {
tableName = this.SqlBuilder.GetTranslationTableName(tableName); tableName = this.SqlBuilder.GetTranslationTableName(tableName);