mirror of https://github.com/abpframework/abp.git
8 changed files with 54 additions and 41 deletions
@ -1,10 +1,7 @@ |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Uow |
|||
namespace Volo.Abp.Uow |
|||
{ |
|||
public interface IDatabaseApi |
|||
{ |
|||
Task SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken)); |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Uow |
|||
{ |
|||
public interface ISupportsSavingChanges |
|||
{ |
|||
void SaveChanges(); |
|||
|
|||
Task SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken)); |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
using System.Threading; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace Volo.Abp.Uow |
|||
{ |
|||
public static class UnitOfWorkExtensions |
|||
{ |
|||
//TODO: Implement all sync versions
|
|||
|
|||
public static void Complete([NotNull] this IUnitOfWork unitOfWork, CancellationToken cancellationToken = default(CancellationToken)) |
|||
{ |
|||
Check.NotNull(unitOfWork, nameof(unitOfWork)); |
|||
|
|||
AsyncHelper.RunSync(() => unitOfWork.CompleteAsync(cancellationToken)); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue