diff --git a/Examples/aspnetcore_transaction/TransactionalAttribute.cs b/Examples/aspnetcore_transaction/TransactionalAttribute.cs index 71f8cbc4..2dd58ad2 100644 --- a/Examples/aspnetcore_transaction/TransactionalAttribute.cs +++ b/Examples/aspnetcore_transaction/TransactionalAttribute.cs @@ -14,7 +14,7 @@ namespace FreeSql [AttributeUsage(AttributeTargets.Method)] public class TransactionalAttribute : DynamicProxyAttribute, IActionFilter { - public Propagation Propagation { get; set; } = Propagation.Requierd; + public Propagation Propagation { get; set; } = Propagation.Required; public IsolationLevel IsolationLevel { get => _IsolationLevelPriv.Value; set => _IsolationLevelPriv = value; } IsolationLevel? _IsolationLevelPriv; diff --git a/FreeSql.DbContext/UnitOfWork/UnitOfWorkManager.cs b/FreeSql.DbContext/UnitOfWork/UnitOfWorkManager.cs index 2cf087b3..e4ae8931 100644 --- a/FreeSql.DbContext/UnitOfWork/UnitOfWorkManager.cs +++ b/FreeSql.DbContext/UnitOfWork/UnitOfWorkManager.cs @@ -85,11 +85,12 @@ namespace FreeSql /// 事务传播方式 /// 事务隔离级别 /// - public IUnitOfWork Begin(Propagation propagation = Propagation.Requierd, IsolationLevel? isolationLevel = null) + public IUnitOfWork Begin(Propagation propagation = Propagation.Required, IsolationLevel? isolationLevel = null) { + if (propagation == Propagation.Requierd) propagation = Propagation.Required; switch (propagation) { - case Propagation.Requierd: return FindedUowCreateVirtual() ?? CreateUow(isolationLevel); + case Propagation.Required: return FindedUowCreateVirtual() ?? CreateUow(isolationLevel); case Propagation.Supports: return FindedUowCreateVirtual() ?? CreateUowNothing(_allUows.LastOrDefault()?.IsNotSupported ?? false); case Propagation.Mandatory: return FindedUowCreateVirtual() ?? throw new Exception("Propagation_Mandatory: 使用当前事务,如果没有当前事务,就抛出异常"); case Propagation.NotSupported: return CreateUowNothing(true); @@ -252,7 +253,7 @@ namespace FreeSql /// /// 如果当前没有事务,就新建一个事务,如果已存在一个事务中,加入到这个事务中,默认的选择。 /// - Requierd, + Required, /// /// 支持当前事务,如果没有当前事务,就以非事务方法执行。 /// @@ -272,6 +273,13 @@ namespace FreeSql /// /// 以嵌套事务方式执行。 /// - Nested + Nested, + + + /// + /// 错误的命名,请使用 Required,在 2.0.0 删除 + /// + [Obsolete("错误的命名,请使用 Required,在 2.0.0 删除")] + Requierd = 404 } }