- 优化 DbContext/Repository Orm 属性进行 CURD 与自身事务相同【新突破】;#270

This commit is contained in:
28810
2020-04-10 19:54:43 +08:00
parent d97dc3383c
commit 52fbe5ed86
17 changed files with 3884 additions and 3849 deletions

View File

@ -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;