0
0

TransactionAttribute.cs 656 B

1234567891011121314151617181920212223242526272829
  1. using FreeSql;
  2. using System;
  3. using System.Data;
  4. using ZhonTai.Admin.Core.Consts;
  5. namespace ZhonTai.Admin.Core.Attributes;
  6. /// <summary>
  7. /// 启用事物
  8. /// </summary>
  9. [AttributeUsage(AttributeTargets.Method, Inherited = true)]
  10. public class TransactionAttribute : Attribute
  11. {
  12. /// <summary>
  13. /// 事务传播方式
  14. /// </summary>
  15. public Propagation Propagation { get; set; } = Propagation.Required;
  16. /// <summary>
  17. /// 事务隔离级别
  18. /// </summary>
  19. public IsolationLevel IsolationLevel { get; set; }
  20. /// <summary>
  21. /// 数据库键
  22. /// </summary>
  23. public string DbKey { get; set; } = DbKeys.MasterDb;
  24. }