Synchronization code

This commit is contained in:
sunkaixuan 2022-12-10 13:20:38 +08:00
parent bc98ab8eb3
commit 036e82fbf0

View File

@ -190,16 +190,17 @@ namespace SqlSugar
}
public IUpdateable<T> AS(string tableName)
{
if (tableName == null) return this;
var entityName = typeof(T).Name;
IsAs = true;
OldMappingTableList = this.Context.MappingTables;
this.Context.MappingTables = this.Context.Utilities.TranslateCopy(this.Context.MappingTables);
if (this.Context.MappingTables.Any(it => it.EntityName == entityName))
{
this.Context.MappingTables.Add(this.Context.MappingTables.First(it => it.EntityName == entityName).DbTableName, tableName);
}
this.Context.MappingTables.Add(entityName, tableName);
//if (tableName == null) return this;
//var entityName = typeof(T).Name;
//IsAs = true;
//OldMappingTableList = this.Context.MappingTables;
//this.Context.MappingTables = this.Context.Utilities.TranslateCopy(this.Context.MappingTables);
//if (this.Context.MappingTables.Any(it => it.EntityName == entityName))
//{
// this.Context.MappingTables.Add(this.Context.MappingTables.First(it => it.EntityName == entityName).DbTableName, tableName);
//}
//this.Context.MappingTables.Add(entityName, tableName);
this.UpdateBuilder.TableName = tableName;
return this; ;
}
public IUpdateable<T> EnableDiffLogEventIF(bool isEnableDiffLog, object businessData = null)