Table of Contents

Interface IAsyncWriteRepository<TEntity>

Namespace
eQuantic.Core.Data.Repository.Write
Assembly
eQuantic.Core.Data.dll

The asynchronous write repository.

public interface IAsyncWriteRepository<TEntity> : IAsyncRepository, IRepository, IDisposable where TEntity : class, IEntity

Type Parameters

TEntity

The type of the entity.

Inherited Members

Methods

AddAsync(TEntity, CancellationToken)

Adds an item into the repository.

Task AddAsync(TEntity item, CancellationToken cancellationToken = default)

Parameters

item TEntity

The item to add.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

AddRangeAsync(IEnumerable<TEntity>, CancellationToken)

Adds a range of items into the repository.

Task AddRangeAsync(IEnumerable<TEntity> items, CancellationToken cancellationToken = default)

Parameters

items IEnumerable<TEntity>

The items to add.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

DeleteManyAsync(Expression<Func<TEntity, bool>>, CancellationToken)

Deletes the elements matching the supplied predicate.

Task<long> DeleteManyAsync(Expression<Func<TEntity, bool>> filter, CancellationToken cancellationToken = default)

Parameters

filter Expression<Func<TEntity, bool>>

The predicate to apply.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The number of deleted elements.

DeleteManyAsync(ISpecification<TEntity>, CancellationToken)

Deletes the elements matching the supplied specification.

Task<long> DeleteManyAsync(ISpecification<TEntity> specification, CancellationToken cancellationToken = default)

Parameters

specification ISpecification<TEntity>

The specification to apply.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The number of deleted elements.

MergeAsync(TEntity, TEntity)

Sets a modified entity into the repository. Changes are persisted when the unit of work is committed.

Task MergeAsync(TEntity persisted, TEntity current)

Parameters

persisted TEntity

The persisted item.

current TEntity

The current item.

Returns

Task

ModifyAsync(TEntity)

Marks an item as modified.

Task ModifyAsync(TEntity item)

Parameters

item TEntity

The item to modify.

Returns

Task

RemoveAsync(TEntity)

Removes an item.

Task RemoveAsync(TEntity item)

Parameters

item TEntity

The item to remove.

Returns

Task

UpdateManyAsync(Expression<Func<TEntity, bool>>, Expression<Func<TEntity, TEntity>>, CancellationToken)

Updates the elements matching the supplied predicate.

Task<long> UpdateManyAsync(Expression<Func<TEntity, bool>> filter, Expression<Func<TEntity, TEntity>> updateFactory, CancellationToken cancellationToken = default)

Parameters

filter Expression<Func<TEntity, bool>>

The predicate to apply.

updateFactory Expression<Func<TEntity, TEntity>>

The update expression.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The number of updated elements.

UpdateManyAsync(ISpecification<TEntity>, Expression<Func<TEntity, TEntity>>, CancellationToken)

Updates the elements matching the supplied specification.

Task<long> UpdateManyAsync(ISpecification<TEntity> specification, Expression<Func<TEntity, TEntity>> updateFactory, CancellationToken cancellationToken = default)

Parameters

specification ISpecification<TEntity>

The specification to apply.

updateFactory Expression<Func<TEntity, TEntity>>

The update expression.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The number of updated elements.

See Also