mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
- 修复 2.0.103 Uow.Orm 事务 bug;
This commit is contained in:
parent
8182238087
commit
32d4f671fe
@ -27,6 +27,10 @@ namespace aspnetcore_transaction.Controllers
|
||||
virtual public object Get([FromServices] BaseRepository<Song> repoSong, [FromServices] BaseRepository<Detail> repoDetail, [FromServices] SongRepository repoSong2,
|
||||
[FromServices] SongService serviceSong)
|
||||
{
|
||||
//repoSong.Insert(new Song());
|
||||
//repoDetail.Insert(new Detail());
|
||||
//repoSong2.Insert(new Song());
|
||||
|
||||
serviceSong.Test1();
|
||||
return "111";
|
||||
}
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
|
||||
<PackageReference Include="FreeSql.DynamicProxy" Version="1.4.0" />
|
||||
<PackageReference Include="IdleBus" Version="1.5.0" />
|
||||
<PackageReference Include="FreeSql.DynamicProxy" Version="1.5.0" />
|
||||
<PackageReference Include="IdleBus" Version="1.5.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -13,7 +13,8 @@ namespace FreeSql
|
||||
/// </summary>
|
||||
public class UnitOfWorkManager : IDisposable
|
||||
{
|
||||
DbContextScopedFreeSql _ormScoped;
|
||||
internal DbContextScopedFreeSql _ormScoped;
|
||||
internal IFreeSql OrmOriginal => _ormScoped?._originalFsql;
|
||||
public IFreeSql Orm => _ormScoped;
|
||||
List<UowInfo> _rawUows = new List<UowInfo>();
|
||||
List<UowInfo> _allUows = new List<UowInfo>();
|
||||
@ -136,7 +137,7 @@ namespace FreeSql
|
||||
}
|
||||
IUnitOfWork CreateUow(IsolationLevel? isolationLevel)
|
||||
{
|
||||
var uow = new UnitOfWorkOrginal(new UnitOfWork(Orm));
|
||||
var uow = new UnitOfWorkOrginal(new UnitOfWork(OrmOriginal));
|
||||
var uowInfo = new UowInfo(uow, UowInfo.UowType.Orginal, false);
|
||||
if (isolationLevel != null) uow.IsolationLevel = isolationLevel.Value;
|
||||
try { uow.GetOrBeginTransaction(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user