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
TEntityThe type of the entity.
- Inherited Members
Methods
AddAsync(TEntity, CancellationToken)
Adds an item into the repository.
Task AddAsync(TEntity item, CancellationToken cancellationToken = default)
Parameters
itemTEntityThe item to add.
cancellationTokenCancellationTokenThe cancellation token.
Returns
AddRangeAsync(IEnumerable<TEntity>, CancellationToken)
Adds a range of items into the repository.
Task AddRangeAsync(IEnumerable<TEntity> items, CancellationToken cancellationToken = default)
Parameters
itemsIEnumerable<TEntity>The items to add.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
filterExpression<Func<TEntity, bool>>The predicate to apply.
cancellationTokenCancellationTokenThe cancellation token.
Returns
DeleteManyAsync(ISpecification<TEntity>, CancellationToken)
Deletes the elements matching the supplied specification.
Task<long> DeleteManyAsync(ISpecification<TEntity> specification, CancellationToken cancellationToken = default)
Parameters
specificationISpecification<TEntity>The specification to apply.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
persistedTEntityThe persisted item.
currentTEntityThe current item.
Returns
ModifyAsync(TEntity)
Marks an item as modified.
Task ModifyAsync(TEntity item)
Parameters
itemTEntityThe item to modify.
Returns
RemoveAsync(TEntity)
Removes an item.
Task RemoveAsync(TEntity item)
Parameters
itemTEntityThe item to remove.
Returns
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
filterExpression<Func<TEntity, bool>>The predicate to apply.
updateFactoryExpression<Func<TEntity, TEntity>>The update expression.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
specificationISpecification<TEntity>The specification to apply.
updateFactoryExpression<Func<TEntity, TEntity>>The update expression.
cancellationTokenCancellationTokenThe cancellation token.