Synchronization code

This commit is contained in:
sunkaixuan
2023-05-24 18:22:58 +08:00
parent c102d2ed84
commit aca438f018
2 changed files with 32 additions and 19 deletions

View File

@@ -1138,6 +1138,16 @@ namespace SqlSugar
{
return this.Select<TResult>(expression);
}
if (sql.StartsWith("*,"))
{
var columns = this.Context.EntityMaintenance.GetEntityInfo<T>()
.Columns.Where(it => typeof(TResult).GetProperties().Any(s => s.Name.EqualCase(it.PropertyName))).Where(it => it.IsIgnore == false).ToList();
if (columns.Any())
{
sql = string.Join(",", columns.Select(it => $"{SqlBuilder.GetTranslationColumnName(it.DbColumnName)} AS {SqlBuilder.GetTranslationColumnName(it.PropertyName)} "))
+ "," + sql.TrimStart('*').TrimStart(',');
}
}
if (this.QueryBuilder.TableShortName.IsNullOrEmpty())
{
this.QueryBuilder.TableShortName = clone.QueryBuilder.TableShortName;