mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
update TransactionalAttribute
This commit is contained in:
parent
713ef26909
commit
7c112861c0
@ -15,7 +15,8 @@ namespace FreeSql
|
||||
public class TransactionalAttribute : DynamicProxyAttribute, IActionFilter
|
||||
{
|
||||
public Propagation Propagation { get; set; } = Propagation.Requierd;
|
||||
public IsolationLevel? IsolationLevel { get; set; }
|
||||
public IsolationLevel IsolationLevel { get => _IsolationLevelPriv.Value; set => _IsolationLevelPriv = value; }
|
||||
IsolationLevel? _IsolationLevelPriv;
|
||||
|
||||
[DynamicProxyFromServices]
|
||||
UnitOfWorkManager _uowManager;
|
||||
@ -31,7 +32,7 @@ namespace FreeSql
|
||||
|
||||
Task OnBefore(UnitOfWorkManager uowm)
|
||||
{
|
||||
_uow = uowm.Begin(this.Propagation, this.IsolationLevel);
|
||||
_uow = uowm.Begin(this.Propagation, this._IsolationLevelPriv);
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
Task OnAfter(Exception ex)
|
||||
|
@ -93,7 +93,7 @@ var items = UserGroup.Where(a => a.Id > 10).ToList();
|
||||
|
||||
# 事务建议
|
||||
|
||||
由于 AsyncLocal 平台兼容不好,所以交给外部管理。
|
||||
由于 AsyncLocal 平台兼容不好,所以交给外部管理事务。
|
||||
|
||||
```csharp
|
||||
static AsyncLocal<IUnitOfWork> _asyncUow = new AsyncLocal<IUnitOfWork>();
|
||||
|
@ -93,7 +93,7 @@ var items = UserGroup.Where(a => a.Id > 10).ToList();
|
||||
|
||||
# 事务建议
|
||||
|
||||
由于 AsyncLocal 平台兼容不好,所以交给外部管理。
|
||||
由于 AsyncLocal 平台兼容不好,所以交给外部管理事务。
|
||||
|
||||
```csharp
|
||||
static AsyncLocal<IUnitOfWork> _asyncUow = new AsyncLocal<IUnitOfWork>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user