修改引用对象 SqlSugarScope
This commit is contained in:
tianyu 2021-11-18 10:00:48 +08:00
parent 06b7f8abe8
commit 8eb59ee3da
4 changed files with 5 additions and 5 deletions

View File

@ -93,7 +93,7 @@ namespace Blog.Core.Extensions
} }
); );
}); });
return new SqlSugarClient(listConfig); return new SqlSugarScope(listConfig);
}); });
} }

View File

@ -16,7 +16,7 @@ namespace Blog.Core.Repository.Base
public class BaseRepository<TEntity> : IBaseRepository<TEntity> where TEntity : class, new() public class BaseRepository<TEntity> : IBaseRepository<TEntity> where TEntity : class, new()
{ {
private readonly IUnitOfWork _unitOfWork; private readonly IUnitOfWork _unitOfWork;
private SqlSugarClient _dbBase; private SqlSugarScope _dbBase;
private ISqlSugarClient _db private ISqlSugarClient _db
{ {

View File

@ -4,7 +4,7 @@ namespace Blog.Core.IRepository.UnitOfWork
{ {
public interface IUnitOfWork public interface IUnitOfWork
{ {
SqlSugarClient GetDbClient(); SqlSugarScope GetDbClient();
void BeginTran(); void BeginTran();

View File

@ -20,10 +20,10 @@ namespace Blog.Core.Repository.UnitOfWork
/// 获取DB保证唯一性 /// 获取DB保证唯一性
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public SqlSugarClient GetDbClient() public SqlSugarScope GetDbClient()
{ {
// 必须要as后边会用到切换数据库操作 // 必须要as后边会用到切换数据库操作
return _sqlSugarClient as SqlSugarClient; return _sqlSugarClient as SqlSugarScope;
} }
public void BeginTran() public void BeginTran()