Browse Source

Synchronization code

pull/31/head
sunkaixuan 2 years ago
parent
commit
f1b7071798
  1. 13
      Src/Asp.NetCore2/SqlSugar/SugarUnitOfWork.cs

13
Src/Asp.NetCore2/SqlSugar/SugarUnitOfWork.cs

@ -24,7 +24,18 @@ namespace SqlSugar
return Db.CreateContext<T>(isTran); return Db.CreateContext<T>(isTran);
} }
} }
public class SugarUnitOfWork : IDisposable public interface ISugarUnitOfWork
{
ISqlSugarClient Db { get; }
ITenant Tenant { get; }
SimpleClient<T> GetRepository<T>() where T : class, new();
RepositoryType GetMyRepository<RepositoryType>() where RepositoryType : ISugarRepository, new();
bool Commit();
}
public class SugarUnitOfWork : IDisposable, ISugarUnitOfWork
{ {
public ISqlSugarClient Db { get; internal set; } public ISqlSugarClient Db { get; internal set; }
public ITenant Tenant { get; internal set; } public ITenant Tenant { get; internal set; }

Loading…
Cancel
Save