diff --git a/Src/Asp.NetCore2/SqlSugar/SugarUnitOfWork.cs b/Src/Asp.NetCore2/SqlSugar/SugarUnitOfWork.cs index 5bee50c63..d47ec95d3 100644 --- a/Src/Asp.NetCore2/SqlSugar/SugarUnitOfWork.cs +++ b/Src/Asp.NetCore2/SqlSugar/SugarUnitOfWork.cs @@ -24,7 +24,18 @@ namespace SqlSugar return Db.CreateContext(isTran); } } - public class SugarUnitOfWork : IDisposable + public interface ISugarUnitOfWork + { + ISqlSugarClient Db { get; } + ITenant Tenant { get; } + + SimpleClient GetRepository() where T : class, new(); + + RepositoryType GetMyRepository() where RepositoryType : ISugarRepository, new(); + + bool Commit(); + } + public class SugarUnitOfWork : IDisposable, ISugarUnitOfWork { public ISqlSugarClient Db { get; internal set; } public ITenant Tenant { get; internal set; }