Synchronization code

This commit is contained in:
sunkaixuan 2023-01-18 01:29:27 +08:00
parent c47a5c3ad8
commit 9f8b7c16b9
2 changed files with 14 additions and 5 deletions

View File

@ -24,17 +24,17 @@ namespace SqlSugar
return Db.CreateContext<T>(isTran);
}
}
public interface ISaugarUnitOfWorkClear
public interface ISugarUnitOfWorkClear
{
RepositoryType GetMyRepository<RepositoryType>() where RepositoryType : new();
bool Commit();
}
/// <summary>
/// ISaugarUnitOfWorkClear not exists SqlSugar method
/// ISugarUnitOfWorkClear not exists SqlSugar method
/// ISugarUnitOfWork exists SqlSugar method
/// </summary>
public interface ISugarUnitOfWork : ISaugarUnitOfWorkClear
public interface ISugarUnitOfWork : ISugarUnitOfWorkClear
{
ISqlSugarClient Db { get; }
ITenant Tenant { get; }

View File

@ -24,19 +24,28 @@ namespace SqlSugar
return Db.CreateContext<T>(isTran);
}
}
public interface ISaugarUnitOfWorkClear
public interface ISugarUnitOfWorkClear
{
RepositoryType GetMyRepository<RepositoryType>() where RepositoryType : new();
bool Commit();
}
public interface ISugarUnitOfWork : ISaugarUnitOfWorkClear
/// <summary>
/// ISugarUnitOfWorkClear not exists SqlSugar method
/// ISugarUnitOfWork exists SqlSugar method
/// </summary>
public interface ISugarUnitOfWork : ISugarUnitOfWorkClear
{
ISqlSugarClient Db { get; }
ITenant Tenant { get; }
SimpleClient<T> GetRepository<T>() where T : class, new();
}
/// <summary>
/// SugarUnitOfWork->ISugarUnitOfWork->ISaugarUnitOfWorkClear
/// ISaugarUnitOfWorkClear not exists SqlSugar method
/// ISugarUnitOfWork exists SqlSugar method
/// </summary>
public class SugarUnitOfWork : IDisposable, ISugarUnitOfWork
{
public ISqlSugarClient Db { get; internal set; }