From f1b7071798099d01f8911f46e28da0676baad55f Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 18 Jan 2023 00:55:28 +0800 Subject: [PATCH] Synchronization code --- Src/Asp.NetCore2/SqlSugar/SugarUnitOfWork.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; }