Interface IWriteRepository<TEntity>
- Namespace
- eQuantic.Core.Data.Repository.Write
- Assembly
- eQuantic.Core.Data.dll
The synchronous write repository.
public interface IWriteRepository<TEntity> : IRepository, IDisposable where TEntity : class, IEntity
Type Parameters
TEntityThe type of the entity.
- Inherited Members
Methods
Add(TEntity)
Adds an item into the repository.
void Add(TEntity item)
Parameters
itemTEntityThe item to add.
AddRange(IEnumerable<TEntity>)
Adds a range of items into the repository.
void AddRange(IEnumerable<TEntity> items)
Parameters
itemsIEnumerable<TEntity>The items to add.
DeleteMany(Expression<Func<TEntity, bool>>)
Deletes the elements matching the supplied predicate.
long DeleteMany(Expression<Func<TEntity, bool>> filter)
Parameters
filterExpression<Func<TEntity, bool>>The predicate to apply.
Returns
- long
The number of deleted elements.
DeleteMany(ISpecification<TEntity>)
Deletes the elements matching the supplied specification.
long DeleteMany(ISpecification<TEntity> specification)
Parameters
specificationISpecification<TEntity>The specification to apply.
Returns
- long
The number of deleted elements.
Merge(TEntity, TEntity)
Sets a modified entity into the repository. Changes are persisted when the unit of work is committed.
void Merge(TEntity persisted, TEntity current)
Parameters
persistedTEntityThe persisted item.
currentTEntityThe current item.
Modify(TEntity)
Marks an item as modified.
void Modify(TEntity item)
Parameters
itemTEntityThe item to modify.
Remove(TEntity)
Removes an item.
void Remove(TEntity item)
Parameters
itemTEntityThe item to remove.
TrackItem(TEntity)
Tracks an item into this repository (through the unit of work).
void TrackItem(TEntity item)
Parameters
itemTEntityThe item to track.
UpdateMany(Expression<Func<TEntity, bool>>, Expression<Func<TEntity, TEntity>>)
Updates the elements matching the supplied predicate.
long UpdateMany(Expression<Func<TEntity, bool>> filter, Expression<Func<TEntity, TEntity>> updateFactory)
Parameters
filterExpression<Func<TEntity, bool>>The predicate to apply.
updateFactoryExpression<Func<TEntity, TEntity>>The update expression.
Returns
- long
The number of updated elements.
UpdateMany(ISpecification<TEntity>, Expression<Func<TEntity, TEntity>>)
Updates the elements matching the supplied specification.
long UpdateMany(ISpecification<TEntity> specification, Expression<Func<TEntity, TEntity>> updateFactory)
Parameters
specificationISpecification<TEntity>The specification to apply.
updateFactoryExpression<Func<TEntity, TEntity>>The update expression.
Returns
- long
The number of updated elements.