mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-18 14:20:55 +08:00
update
2
事务.md
2
事务.md
@@ -12,7 +12,7 @@ using (var uow = fsql.CreateUnitOfWork()) {
|
||||
}
|
||||
```
|
||||
|
||||
.NetCore 无须像上面的硬编码方式:[在 asp.net core 中使用 TransactionalAttribute + UnitOfWorkManager 实现多种事务传播](https://github.com/dotnetcore/FreeSql/issues/289)
|
||||
参考:[在 asp.net core 中使用 TransactionalAttribute + UnitOfWorkManager 实现多种事务传播](https://github.com/dotnetcore/FreeSql/issues/289)
|
||||
|
||||
## 2、DbContext
|
||||
|
||||
|
||||
11
工作单元.md
11
工作单元.md
@@ -15,16 +15,17 @@ static IFreeSql fsql = new FreeSql.FreeSqlBuilder()
|
||||
|
||||
```csharp
|
||||
using (var uow = fsql.CreateUnitOfWork()) {
|
||||
var songRepo = uow.GetRepository<Song>();
|
||||
var userRepo = uow.GetRepository<User>();
|
||||
var songRepo = fsql.GetRepository<Song>() { UnitOfWork = uow };
|
||||
var userRepo = fsql.GetRepository<User>() { UnitOfWork = uow };
|
||||
|
||||
//这里不受异步方法影响
|
||||
songRepo.Insert(new Song());
|
||||
userRepo.Update(...);
|
||||
|
||||
uow.Commit();
|
||||
uow.Commit();
|
||||
}
|
||||
```
|
||||
|
||||
参考:[在 asp.net core 中使用 UnitOfWorkManager 实现多种事务传播](https://github.com/dotnetcore/FreeSql/issues/289)
|
||||
参考:[在 asp.net core 中使用 TransactionalAttribute + UnitOfWorkManager 实现多种事务传播](https://github.com/dotnetcore/FreeSql/issues/289)
|
||||
|
||||
## 接口定义
|
||||
|
||||
|
||||
2
常见问题.md
2
常见问题.md
@@ -24,7 +24,7 @@ fsql.Aop.CurdAfter += (s, e) =>
|
||||
|
||||
---
|
||||
|
||||
### 3、在 asp.net core 中使用 UnitOfWorkManager 实现多种事务传播
|
||||
### 3、在 asp.net core 中使用 TransactionalAttribute + UnitOfWorkManager 实现多种事务传播
|
||||
|
||||
[https://github.com/dotnetcore/FreeSql/issues/289](https://github.com/dotnetcore/FreeSql/issues/289)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user