- 修复 2.0.103 Uow.Orm 事务 bug;

This commit is contained in:
2881099
2020-12-07 20:18:35 +08:00
parent ff1354d46c
commit 87f2cba55f
5 changed files with 215 additions and 10 deletions

View File

@ -499,6 +499,35 @@ namespace FreeSql.Tests
public string Name { get; set; }
}
[Fact]
public void OrmScoped()
{
var fsql = g.sqlserver;
//fsql.Aop.CommandBefore += (s, e) =>
//{
// Console.WriteLine(e.Command.CommandText);
//};
var repo = fsql.GetRepository<ts_repo_update_bit>();
repo.Orm.Ado.ExecuteNonQuery("select 1");
using (var ctx = fsql.CreateDbContext())
{
ctx.Orm.Ado.ExecuteNonQuery("select 1");
}
using (var uow = fsql.CreateUnitOfWork())
{
uow.Orm.Ado.ExecuteNonQuery("select 1");
}
using (var uow = fsql.CreateUnitOfWork())
{
repo.UnitOfWork = uow;
repo.Orm.Ado.ExecuteNonQuery("select 1");
}
}
[Fact]
public void UpdateBit()
{