Browse Source

Update core

pull/2/head
SUNKAIXUAN 4 years ago
parent
commit
be219e10f4
  1. 1
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs
  2. 3
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ExpressionContext.cs
  3. 5
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/Subquery/SubResolve.cs
  4. 1
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Interface/ILambdaExpressions.cs
  5. 6
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/SqlServer/DbMaintenance/SqlServerDbMaintenance.cs

1
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs

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

3
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ExpressionContext.cs

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

5
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/Subquery/SubResolve.cs

@ -63,6 +63,11 @@ namespace SqlSugar
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
{
Check.Exception(true, "I'm sorry I can't parse the current expression");

1
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Interface/ILambdaExpressions.cs

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

6
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/SqlServer/DbMaintenance/SqlServerDbMaintenance.cs

@ -392,6 +392,12 @@ namespace SqlSugar
}
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)
{
tableName = this.SqlBuilder.GetTranslationTableName(tableName);

Loading…
Cancel
Save