mirror of https://github.com/abpframework/abp.git
12 changed files with 71 additions and 69 deletions
@ -0,0 +1,34 @@ |
|||||
|
using System; |
||||
|
using System.Data; |
||||
|
|
||||
|
namespace Volo.Abp.Uow |
||||
|
{ |
||||
|
//TODO: Implement default options!
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Global (default) unit of work options
|
||||
|
/// </summary>
|
||||
|
public class UnitOfWorkDefaultOptions |
||||
|
{ |
||||
|
public UnitOfWorkTransactionBehavior TransactionBehavior { get; set; } |
||||
|
|
||||
|
public IsolationLevel? IsolationLevel { get; set; } |
||||
|
|
||||
|
public TimeSpan? Timeout { get; set; } |
||||
|
|
||||
|
internal UnitOfWorkOptions Normalize(UnitOfWorkOptions options) |
||||
|
{ |
||||
|
if (options.IsolationLevel == null) |
||||
|
{ |
||||
|
options.IsolationLevel = IsolationLevel; |
||||
|
} |
||||
|
|
||||
|
if (options.Timeout == null) |
||||
|
{ |
||||
|
options.Timeout = Timeout; |
||||
|
} |
||||
|
|
||||
|
return options; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,27 +0,0 @@ |
|||||
using System; |
|
||||
using System.Data; |
|
||||
|
|
||||
namespace Volo.Abp.Uow |
|
||||
{ |
|
||||
public class UnitOfWorkStartOptions : IUnitOfWorkStartOptions |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// Default: false.
|
|
||||
/// </summary>
|
|
||||
public bool IsTransactional { get; set; } |
|
||||
|
|
||||
public IsolationLevel? IsolationLevel { get; set; } |
|
||||
|
|
||||
public TimeSpan? Timeout { get; set; } |
|
||||
|
|
||||
public UnitOfWorkStartOptions Clone() |
|
||||
{ |
|
||||
return new UnitOfWorkStartOptions |
|
||||
{ |
|
||||
IsTransactional = IsTransactional, |
|
||||
IsolationLevel = IsolationLevel, |
|
||||
Timeout = Timeout |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue