diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs index 87aeab1a1..64b00ee4e 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs @@ -269,6 +269,10 @@ namespace SqlSugar var columnsResult = this.Context.EntityMaintenance.GetEntityInfo().Columns; sql = AppendSelect(sql, parameters, columnsResult, 0); sql = AppendSelect(sql, parameters, columnsResult, 1); + if (sql.Trim().First()==',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } #endregion @@ -983,6 +987,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 0); sql = AppendSelect(sql, parameters, columnsResult, 1); sql = AppendSelect(sql, parameters, columnsResult, 2); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } @@ -1595,6 +1603,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 1); sql = AppendSelect(sql, parameters, columnsResult, 2); sql = AppendSelect(sql, parameters, columnsResult, 3); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } @@ -2346,6 +2358,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 2); sql = AppendSelect(sql, parameters, columnsResult, 3); sql = AppendSelect(sql, parameters, columnsResult, 4); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider06-10.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider06-10.cs index 004006b78..4acfaec6f 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider06-10.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider06-10.cs @@ -329,6 +329,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 3); sql = AppendSelect(sql, parameters, columnsResult, 4); sql = AppendSelect(sql, parameters, columnsResult, 5); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } #endregion @@ -1058,6 +1062,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 4); sql = AppendSelect(sql, parameters, columnsResult, 5); sql = AppendSelect(sql, parameters, columnsResult, 6); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } @@ -1794,6 +1802,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 5); sql = AppendSelect(sql, parameters, columnsResult, 6); sql = AppendSelect(sql, parameters, columnsResult, 7); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } @@ -2444,6 +2456,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 6); sql = AppendSelect(sql, parameters, columnsResult, 7); sql = AppendSelect(sql, parameters, columnsResult, 8); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } @@ -3131,6 +3147,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 7); sql = AppendSelect(sql, parameters, columnsResult, 8); sql = AppendSelect(sql, parameters, columnsResult, 9); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider11-12.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider11-12.cs index 89cff0d84..728b394ad 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider11-12.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider11-12.cs @@ -324,6 +324,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 8); sql = AppendSelect(sql, parameters, columnsResult, 9); sql = AppendSelect(sql, parameters, columnsResult, 10); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } public ISugarQueryable Select(Expression> expression) @@ -914,6 +918,10 @@ namespace SqlSugar sql = AppendSelect(sql, parameters, columnsResult, 9); sql = AppendSelect (sql, parameters, columnsResult, 10); sql = AppendSelect(sql, parameters, columnsResult, 11); + if (sql.Trim().First() == ',') + { + sql = sql.TrimStart(' ').TrimStart(','); + } return this.Select(sql); } public ISugarQueryable Select(Expression> expression) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs index 081ba2b24..cb5c2a1c9 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs @@ -153,11 +153,11 @@ namespace SqlSugar } public void InitMappingInfo(Type type) { - string cacheKey = "Context.InitAttributeMappingTables" + type.FullName; + string cacheKey = "Context.InitAttributeMappingTables" + type.FullName+this.Context?.CurrentConnectionConfig?.ConfigId; var entityInfo = this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () => { - var result = this.Context.EntityMaintenance.GetEntityInfo(type); + var result = this.Context.EntityMaintenance.GetEntityInfoWithAttr(type); return result; }); //var copyObj = CopyEntityInfo(entityInfo); diff --git a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec index 91461b082..e8caca336 100644 --- a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec +++ b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec @@ -2,7 +2,7 @@ SqlSugarCore - 5.1.4.86 + 5.1.4.87-preview06 sunkaixuan 果糖大数据科技 http://www.apache.org/licenses/LICENSE-2.0.html