mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 优化 DbContext/Repository Orm 属性进行 CURD 与自身事务相同【新突破】;#270
This commit is contained in:
@ -11,7 +11,7 @@ namespace FreeSql
|
||||
protected IBaseRepository _repo;
|
||||
public RepositoryDbContext(IFreeSql orm, IBaseRepository repo) : base()
|
||||
{
|
||||
_ormPriv = orm;
|
||||
_ormScoped = DbContextScopedFreeSql.Create(orm, () => this, () => repo.UnitOfWork);
|
||||
_isUseUnitOfWork = false;
|
||||
UnitOfWork = repo.UnitOfWork;
|
||||
_repo = repo;
|
||||
@ -23,7 +23,7 @@ namespace FreeSql
|
||||
{
|
||||
if (_dicSet.ContainsKey(entityType)) return _dicSet[entityType];
|
||||
|
||||
var tb = _ormPriv.CodeFirst.GetTableByEntity(entityType);
|
||||
var tb = OrmOriginal.CodeFirst.GetTableByEntity(entityType);
|
||||
if (tb == null) return null;
|
||||
|
||||
object repo = _repo;
|
||||
|
Reference in New Issue
Block a user