|
|
|
@ -1,15 +1,27 @@
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.Uow
|
|
|
|
|
{
|
|
|
|
|
public static class UnitOfWorkManagerExtensions
|
|
|
|
|
{
|
|
|
|
|
[NotNull]
|
|
|
|
|
public static IUnitOfWork Begin([NotNull] this IUnitOfWorkManager unitOfWorkManager, bool requiresNew = false)
|
|
|
|
|
public static IUnitOfWork Begin(
|
|
|
|
|
[NotNull] this IUnitOfWorkManager unitOfWorkManager,
|
|
|
|
|
bool requiresNew = false,
|
|
|
|
|
bool isTransactional = false,
|
|
|
|
|
IsolationLevel? isolationLevel = null,
|
|
|
|
|
TimeSpan? timeout = null)
|
|
|
|
|
{
|
|
|
|
|
Check.NotNull(unitOfWorkManager, nameof(unitOfWorkManager));
|
|
|
|
|
|
|
|
|
|
return unitOfWorkManager.Begin(new AbpUnitOfWorkOptions(), requiresNew);
|
|
|
|
|
return unitOfWorkManager.Begin(new AbpUnitOfWorkOptions
|
|
|
|
|
{
|
|
|
|
|
IsTransactional = isTransactional,
|
|
|
|
|
IsolationLevel = isolationLevel,
|
|
|
|
|
Timeout = timeout
|
|
|
|
|
}, requiresNew);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void BeginReserved([NotNull] this IUnitOfWorkManager unitOfWorkManager, [NotNull] string reservationName)
|
|
|
|
|