IUnitOfWorkDefaultOptions.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Transactions;
  4. namespace Abp.Domain.Uow
  5. {
  6. /// <summary>
  7. /// Used to get/set default options for a unit of work.
  8. /// </summary>
  9. public interface IUnitOfWorkDefaultOptions
  10. {
  11. /// <summary>
  12. /// Scope option.
  13. /// </summary>
  14. TransactionScopeOption Scope { get; set; }
  15. /// <summary>
  16. /// Should unit of works be transactional.
  17. /// Default: true.
  18. /// </summary>
  19. bool IsTransactional { get; set; }
  20. /// <summary>
  21. /// A boolean value indicates that System.Transactions.TransactionScope is available for current application.
  22. /// Default: true.
  23. /// </summary>
  24. bool IsTransactionScopeAvailable { get; set; }
  25. /// <summary>
  26. /// Gets/sets a timeout value for unit of works.
  27. /// </summary>
  28. TimeSpan? Timeout { get; set; }
  29. /// <summary>
  30. /// Gets/sets isolation level of transaction.
  31. /// This is used if <see cref="IsTransactional"/> is true.
  32. /// </summary>
  33. IsolationLevel? IsolationLevel { get; set; }
  34. /// <summary>
  35. /// Gets list of all data filter configurations.
  36. /// </summary>
  37. IReadOnlyList<DataFilterConfiguration> Filters { get; }
  38. /// <summary>
  39. /// A list of selectors to determine conventional Unit Of Work classes.
  40. /// </summary>
  41. List<Func<Type, bool>> ConventionalUowSelectors { get; }
  42. /// <summary>
  43. /// Registers a data filter to unit of work system.
  44. /// </summary>
  45. /// <param name="filterName">Name of the filter.</param>
  46. /// <param name="isEnabledByDefault">Is filter enabled by default.</param>
  47. void RegisterFilter(string filterName, bool isEnabledByDefault);
  48. /// <summary>
  49. /// Overrides a data filter definition.
  50. /// </summary>
  51. /// <param name="filterName">Name of the filter.</param>
  52. /// <param name="isEnabledByDefault">Is filter enabled by default.</param>
  53. void OverrideFilter(string filterName, bool isEnabledByDefault);
  54. }
  55. }