Interface IUnitOfWork
- Namespace
- eQuantic.Core.Data.Repository
- Assembly
- eQuantic.Core.Data.dll
Contract for the 'Unit Of Work' pattern. For more related info see http://martinfowler.com/eaaCatalog/unitOfWork.html. To comply with the Persistence Ignorance principle in the domain, this contract abstracts the underlying persistence engine.
public interface IUnitOfWork : IDisposable
- Inherited Members
Methods
Commit()
Commits all changes made in the container.
int Commit()
Returns
- int
The number of affected entries.
Commit(Action<SaveOptions>)
Commits all changes made in the container.
int Commit(Action<SaveOptions> options)
Parameters
optionsAction<SaveOptions>The save options.
Returns
- int
The number of affected entries.
CommitAndRefreshChanges()
Commits all changes made in the container, refreshing client changes on conflict.
int CommitAndRefreshChanges()
Returns
- int
The number of affected entries.
CommitAndRefreshChanges(Action<SaveOptions>)
Commits all changes made in the container, refreshing client changes on conflict.
int CommitAndRefreshChanges(Action<SaveOptions> options)
Parameters
optionsAction<SaveOptions>The save options.
Returns
- int
The number of affected entries.
CommitAndRefreshChangesAsync(Action<SaveOptions>, CancellationToken)
Commits all changes made in the container, refreshing client changes on conflict.
Task<int> CommitAndRefreshChangesAsync(Action<SaveOptions> options, CancellationToken cancellationToken = default)
Parameters
optionsAction<SaveOptions>The save options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
CommitAndRefreshChangesAsync(CancellationToken)
Commits all changes made in the container, refreshing client changes on conflict.
Task<int> CommitAndRefreshChangesAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token.
Returns
CommitAsync(Action<SaveOptions>, CancellationToken)
Commits all changes made in the container.
Task<int> CommitAsync(Action<SaveOptions> options, CancellationToken cancellationToken = default)
Parameters
optionsAction<SaveOptions>The save options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
CommitAsync(CancellationToken)
Commits all changes made in the container.
Task<int> CommitAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token.
Returns
GetAsyncRepository<TEntity, TKey>()
Gets the asynchronous entity repository instance.
IAsyncRepository<TEntity, TKey> GetAsyncRepository<TEntity, TKey>() where TEntity : class, IEntity<TKey>
Returns
- IAsyncRepository<TEntity, TKey>
The asynchronous repository.
Type Parameters
TEntityThe entity type.
TKeyThe type of the entity key.
GetRepository<TEntity, TKey>()
Gets the entity repository instance.
IRepository<TEntity, TKey> GetRepository<TEntity, TKey>() where TEntity : class, IEntity<TKey>
Returns
- IRepository<TEntity, TKey>
The repository.
Type Parameters
TEntityThe entity type.
TKeyThe type of the entity key.
RollbackChanges()
Rolls back tracked changes.
void RollbackChanges()