IUnitOfWorkManager.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System.Transactions;
  2. namespace Abp.Domain.Uow
  3. {
  4. /// <summary>
  5. /// Unit of work manager.
  6. /// Used to begin and control a unit of work.
  7. /// </summary>
  8. public interface IUnitOfWorkManager
  9. {
  10. /// <summary>
  11. /// Gets currently active unit of work (or null if not exists).
  12. /// </summary>
  13. IActiveUnitOfWork Current { get; }
  14. /// <summary>
  15. /// Begins a new unit of work.
  16. /// </summary>
  17. /// <returns>A handle to be able to complete the unit of work</returns>
  18. IUnitOfWorkCompleteHandle Begin();
  19. /// <summary>
  20. /// Begins a new unit of work.
  21. /// </summary>
  22. /// <returns>A handle to be able to complete the unit of work</returns>
  23. IUnitOfWorkCompleteHandle Begin(TransactionScopeOption scope);
  24. /// <summary>
  25. /// Begins a new unit of work.
  26. /// </summary>
  27. /// <returns>A handle to be able to complete the unit of work</returns>
  28. IUnitOfWorkCompleteHandle Begin(UnitOfWorkOptions options);
  29. }
  30. }