Browse Source

Synchronization code

pull/29/head
sunkaixuan 2 years ago
parent
commit
036e82fbf0
  1. 21
      Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

21
Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

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

Loading…
Cancel
Save