Browse Source

Add db.CopyNew

SqlSugar5
sunkaixuan 2 years ago
parent
commit
12a9fe1a87
  1. 1
      Src/Asp.Net/SqlSugar/Interface/ISqlSugarClient.cs
  2. 4
      Src/Asp.Net/SqlSugar/SqlSugarClient.cs
  3. 5
      Src/Asp.Net/SqlSugar/SqlSugarScope.cs

1
Src/Asp.Net/SqlSugar/Interface/ISqlSugarClient.cs

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

4
Src/Asp.Net/SqlSugar/SqlSugarClient.cs

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

5
Src/Asp.Net/SqlSugar/SqlSugarScope.cs

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

Loading…
Cancel
Save