|
|
@ -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) |
|
|
|