Table of Contents

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

options Action<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

options Action<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

options Action<SaveOptions>

The save options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of affected entries.

CommitAndRefreshChangesAsync(CancellationToken)

Commits all changes made in the container, refreshing client changes on conflict.

Task<int> CommitAndRefreshChangesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of affected entries.

CommitAsync(Action<SaveOptions>, CancellationToken)

Commits all changes made in the container.

Task<int> CommitAsync(Action<SaveOptions> options, CancellationToken cancellationToken = default)

Parameters

options Action<SaveOptions>

The save options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of affected entries.

CommitAsync(CancellationToken)

Commits all changes made in the container.

Task<int> CommitAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of affected entries.

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

TEntity

The entity type.

TKey

The 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

TEntity

The entity type.

TKey

The type of the entity key.

RollbackChanges()

Rolls back tracked changes.

void RollbackChanges()