mirror of https://github.com/abpframework/abp.git
7 changed files with 42 additions and 49 deletions
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Uow |
|||
{ |
|||
//Find a better naming :(
|
|||
public interface IBasicUnitOfWork : IDisposable |
|||
{ |
|||
void SaveChanges(); |
|||
|
|||
Task SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken)); |
|||
|
|||
void Complete(); |
|||
|
|||
Task CompleteAsync(CancellationToken cancellationToken = default(CancellationToken)); |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
using Volo.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Uow |
|||
{ |
|||
public interface IDatabaseApiContainer : IServiceProviderAccessor |
|||
{ |
|||
[CanBeNull] |
|||
IDatabaseApi FindDatabaseApi([NotNull] string id); |
|||
|
|||
[NotNull] |
|||
IDatabaseApi GetOrAddDatabaseApi(string id, Func<IDatabaseApi> factory); |
|||
} |
|||
} |
|||
@ -1,29 +1,6 @@ |
|||
using System; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using JetBrains.Annotations; |
|||
using Volo.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Uow |
|||
namespace Volo.Abp.Uow |
|||
{ |
|||
public interface IUnitOfWork : IDisposable, IServiceProviderAccessor, ITransientDependency |
|||
public interface IUnitOfWork : IBasicUnitOfWork, IDatabaseApiContainer |
|||
{ |
|||
[CanBeNull] |
|||
IDatabaseApi FindDatabaseApi([NotNull] string id); |
|||
|
|||
//TODO: Move Database API methods to another interface!
|
|||
|
|||
[NotNull] |
|||
IDatabaseApi GetOrAddDatabaseApi(string id, Func<IDatabaseApi> factory); |
|||
|
|||
IDatabaseApi AddDatabaseApi(string id, IDatabaseApi databaseApi); |
|||
|
|||
void SaveChanges(); |
|||
|
|||
Task SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken)); |
|||
|
|||
void Complete(); |
|||
|
|||
Task CompleteAsync(CancellationToken cancellationToken = default(CancellationToken)); |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue