mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Support Updateable.Clone()
This commit is contained in:
parent
0820922cb0
commit
95bd564608
@ -128,6 +128,46 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Common
|
||||
public IUpdateable<T> Clone()
|
||||
{
|
||||
this.Context.SugarActionType = SugarActionType.Update;
|
||||
var result = InstanceFactory.GetUpdateableProvider<T>(this.Context.CurrentConnectionConfig);
|
||||
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig); ;
|
||||
result.Context = this.Context;
|
||||
result.EntityInfo = this.Context.EntityMaintenance.GetEntityInfo<T>();
|
||||
result.SqlBuilder = sqlBuilder;
|
||||
result.SqlBuilder.Context = this.Context;
|
||||
result.UpdateObjs = UpdateObjs;
|
||||
result.WhereColumnList= this.WhereColumnList;
|
||||
result.IsWhereColumns = this.IsWhereColumns;
|
||||
result.IgnoreColumnNameList= this.IgnoreColumnNameList;
|
||||
result.IsAs = this.IsAs;
|
||||
result.IsOffIdentity= this.IsOffIdentity;
|
||||
result.IsEnableDiffLogEvent= this.IsEnableDiffLogEvent;
|
||||
result.diffModel = this.diffModel;
|
||||
result.UpdateParameterIsNull= this.UpdateParameterIsNull;
|
||||
result.RemoveCacheFunc= this.RemoveCacheFunc;
|
||||
result.SetColumnsIndex = this.SetColumnsIndex;
|
||||
result.OldMappingTableList= this.OldMappingTableList;
|
||||
result.MappingColumnList= this.MappingColumnList;
|
||||
result.columns = this.columns.ToList();
|
||||
result.UpdateBuilder = InstanceFactory.GetUpdateBuilder(this.Context.CurrentConnectionConfig);
|
||||
result.UpdateBuilder.Builder = sqlBuilder;
|
||||
result.UpdateBuilder.LambdaExpressions = InstanceFactory.GetLambdaExpressions(this.Context.CurrentConnectionConfig);
|
||||
result.Context=this.Context;
|
||||
result.UpdateBuilder.DbColumnInfoList = this.UpdateBuilder.DbColumnInfoList.ToList();
|
||||
result.UpdateBuilder.TableName= this.UpdateBuilder.TableName;
|
||||
result.UpdateBuilder.WhereValues = this.UpdateBuilder.WhereValues.ToList();
|
||||
result.UpdateBuilder.Parameters= this.UpdateBuilder.Parameters.ToList();
|
||||
result.UpdateBuilder.IsListUpdate= this.UpdateBuilder.IsListUpdate;
|
||||
result.UpdateBuilder.IsWhereColumns= this.UpdateBuilder.IsWhereColumns;
|
||||
result.UpdateBuilder.WhereValues=this.UpdateBuilder.WhereValues.ToList();
|
||||
result.UpdateBuilder.IsNoUpdateDefaultValue = this.UpdateBuilder.IsNoUpdateDefaultValue;
|
||||
result.UpdateBuilder.IsNoUpdateNull= this.UpdateBuilder.IsNoUpdateNull;
|
||||
result.UpdateBuilder.SetValues= this.UpdateBuilder.SetValues.ToList();
|
||||
result.UpdateBuilder.Context = this.Context;
|
||||
return result;
|
||||
}
|
||||
public IUpdateable<T> With(string lockString)
|
||||
{
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.SqlServer)
|
||||
|
@ -104,5 +104,6 @@ namespace SqlSugar
|
||||
SplitTableUpdateProvider<T> SplitTable(Func<List<SplitTableInfo>, IEnumerable<SplitTableInfo>> getTableNamesFunc);
|
||||
SplitTableUpdateByObjectProvider<T> SplitTable();
|
||||
IUpdateable<T> EnableQueryFilter();
|
||||
IUpdateable<T> Clone();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user