mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Synchronization code
This commit is contained in:
parent
3bba2ed1d2
commit
2fa0fda4b5
@ -424,16 +424,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public IInsertable<T> AS(string tableName)
|
public IInsertable<T> AS(string tableName)
|
||||||
{
|
{
|
||||||
if (tableName == null) return this;
|
this.InsertBuilder.AsName = tableName;
|
||||||
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);
|
|
||||||
return this; ;
|
return this; ;
|
||||||
}
|
}
|
||||||
public IInsertable<T> IgnoreColumns(Expression<Func<T, object>> columns)
|
public IInsertable<T> IgnoreColumns(Expression<Func<T, object>> columns)
|
||||||
|
@ -49,6 +49,7 @@ namespace SqlSugar
|
|||||||
var itemable = this.Context.Insertable(item);
|
var itemable = this.Context.Insertable(item);
|
||||||
itemable.InsertBuilder.DbColumnInfoList = itemable.InsertBuilder.DbColumnInfoList.Where(it => columns.Contains(it.DbColumnName)).ToList();
|
itemable.InsertBuilder.DbColumnInfoList = itemable.InsertBuilder.DbColumnInfoList.Where(it => columns.Contains(it.DbColumnName)).ToList();
|
||||||
itemable.InsertBuilder.TableWithString = tableWithString;
|
itemable.InsertBuilder.TableWithString = tableWithString;
|
||||||
|
itemable.InsertBuilder.AsName = Inserable.InsertBuilder.AsName;
|
||||||
(itemable as InsertableProvider<T>).RemoveCacheFunc = removeCacheFunc;
|
(itemable as InsertableProvider<T>).RemoveCacheFunc = removeCacheFunc;
|
||||||
itemable.AddQueue();
|
itemable.AddQueue();
|
||||||
}
|
}
|
||||||
@ -77,6 +78,7 @@ namespace SqlSugar
|
|||||||
var itemable = this.Context.Insertable(item);
|
var itemable = this.Context.Insertable(item);
|
||||||
itemable.InsertBuilder.DbColumnInfoList = itemable.InsertBuilder.DbColumnInfoList.Where(it => columns.Contains(it.DbColumnName)).ToList();
|
itemable.InsertBuilder.DbColumnInfoList = itemable.InsertBuilder.DbColumnInfoList.Where(it => columns.Contains(it.DbColumnName)).ToList();
|
||||||
itemable.InsertBuilder.TableWithString = tableWithString;
|
itemable.InsertBuilder.TableWithString = tableWithString;
|
||||||
|
itemable.InsertBuilder.AsName = Inserable.InsertBuilder.AsName;
|
||||||
(itemable as InsertableProvider<T>).RemoveCacheFunc = removeCacheFunc;
|
(itemable as InsertableProvider<T>).RemoveCacheFunc = removeCacheFunc;
|
||||||
itemable.AddQueue();
|
itemable.AddQueue();
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ namespace SqlSugar
|
|||||||
public virtual bool IsNoPage { get; set; }
|
public virtual bool IsNoPage { get; set; }
|
||||||
|
|
||||||
public virtual bool IsReturnPkList { get; set; }
|
public virtual bool IsReturnPkList { get; set; }
|
||||||
|
public string AsName { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SqlTemplate
|
#region SqlTemplate
|
||||||
@ -115,6 +116,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
if (AsName.HasValue())
|
||||||
|
{
|
||||||
|
return Builder.GetTranslationTableName(AsName);
|
||||||
|
}
|
||||||
var result = Builder.GetTranslationTableName(EntityInfo.EntityName);
|
var result = Builder.GetTranslationTableName(EntityInfo.EntityName);
|
||||||
result += UtilConstants.Space;
|
result += UtilConstants.Space;
|
||||||
if (this.TableWithString.HasValue())
|
if (this.TableWithString.HasValue())
|
||||||
|
Loading…
Reference in New Issue
Block a user