是否可以让UseTransactionAttribute 可使用在 类上,让类里面所有方法都默认使用事务
SmartSql version
4.1.25
Database provider and version
Steps to reproduce
Expected result
namespace SmartSql.DyRepository.Annotations { [AttributeUsage(AttributeTargets.Method||AttributeTargets.Class, AllowMultiple = false)] public class UseTransactionAttribute : Attribute { public IsolationLevel Level { get; set; } = IsolationLevel.Unspecified; } }
Actual result
namespace SmartSql.DyRepository.Annotations { [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class UseTransactionAttribute : Attribute { public IsolationLevel Level { get; set; } = IsolationLevel.Unspecified; } }
Stack trace
UseTransactionAttribute 作用域是 动态仓储接口 , 请使用 SmartSql.AOP 提供的事务注解。 https://github.com/dotnetcore/SmartSql/blob/master/src/SmartSql.AOP/TransactionAttribute.cs
SmartSql.AOP.TransactionAttribute.cs 类注解的作用域,你可以尝试写写,然后提供PR。
好的。已提交PR