ISugarUnitOfWork

This commit is contained in:
sunkaixuan 2022-05-24 11:01:50 +08:00
parent 561ee9f56b
commit 9b3d4ef8cd

View File

@ -10,7 +10,7 @@ namespace SqlSugar
public interface ISugarUnitOfWork<T> where T : SugarUnitOfWork, new() public interface ISugarUnitOfWork<T> where T : SugarUnitOfWork, new()
{ {
ISqlSugarClient Db { get; set; } ISqlSugarClient Db { get; set; }
T CreateContext(bool isTran); T CreateContext(bool isTran=true);
} }
public class SugarUnitOfWork<T> : ISugarUnitOfWork<T> where T : SugarUnitOfWork, new() public class SugarUnitOfWork<T> : ISugarUnitOfWork<T> where T : SugarUnitOfWork, new()
{ {
@ -19,7 +19,7 @@ namespace SqlSugar
this.Db = db; this.Db = db;
} }
public ISqlSugarClient Db { get; set; } public ISqlSugarClient Db { get; set; }
public T CreateContext(bool isTran) public T CreateContext(bool isTran=true)
{ {
return Db.CreateContext<T>(isTran); return Db.CreateContext<T>(isTran);
} }