using System; using System.Data; namespace Magic.Core; /// /// SqlSugar 工作单元配置特性 /// [AttributeUsage(AttributeTargets.Method, Inherited = true)] public class SqlSugarUnitOfWorkAttribute : Attribute { /// /// 构造函数 /// public SqlSugarUnitOfWorkAttribute() { } /// /// 构造函数 /// /// /// 支持传入事务隔离级别 参数值 /// /// 事务隔离级别 public SqlSugarUnitOfWorkAttribute(IsolationLevel isolationLevel) { IsolationLevel = isolationLevel; } /// /// 事务隔离级别 /// /// /// 默认:,参见: /// 说明:当事务A更新某条数据的时候,不容许其他事务来更新该数据,但可以进行读取操作 /// public IsolationLevel IsolationLevel { get; set; } = IsolationLevel.ReadCommitted; }