Add db.CopyNew

This commit is contained in:
sunkaixuan
2022-08-01 15:53:45 +08:00
parent 851879a58b
commit 12a9fe1a87
3 changed files with 9 additions and 1 deletions

View File

@@ -44,6 +44,7 @@ namespace SqlSugar
#endregion
#region Other methods
SqlSugarClient CopyNew();
T CreateContext<T>(bool isTran=true) where T : SugarUnitOfWork, new();
SugarUnitOfWork CreateContext(bool isTran = true);
SplitTableContext SplitHelper<T>() where T : class, new();

View File

@@ -996,6 +996,10 @@ namespace SqlSugar
#endregion
#region Other method
public SqlSugarClient CopyNew()
{
return new SqlSugarClient(UtilMethods.CopyConfig(this.Ado.Context.CurrentConnectionConfig));
}
public DateTime GetDate()
{
return this.Context.GetDate();

View File

@@ -762,6 +762,9 @@ namespace SqlSugar
{
return ScopedContext.UpdateNav(datas);
}
public SqlSugarClient CopyNew()
{
return new SqlSugarClient(UtilMethods.CopyConfig(this.Ado.Context.CurrentConnectionConfig));
}
}
}