Table of Contents

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

TEntity

The type of the entity.

Inherited Members

Methods

Add(TEntity)

Adds an item into the repository.

void Add(TEntity item)

Parameters

item TEntity

The item to add.

AddRange(IEnumerable<TEntity>)

Adds a range of items into the repository.

void AddRange(IEnumerable<TEntity> items)

Parameters

items IEnumerable<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

filter Expression<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

specification ISpecification<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

persisted TEntity

The persisted item.

current TEntity

The current item.

Modify(TEntity)

Marks an item as modified.

void Modify(TEntity item)

Parameters

item TEntity

The item to modify.

Remove(TEntity)

Removes an item.

void Remove(TEntity item)

Parameters

item TEntity

The item to remove.

TrackItem(TEntity)

Tracks an item into this repository (through the unit of work).

void TrackItem(TEntity item)

Parameters

item TEntity

The 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

filter Expression<Func<TEntity, bool>>

The predicate to apply.

updateFactory Expression<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

specification ISpecification<TEntity>

The specification to apply.

updateFactory Expression<Func<TEntity, TEntity>>

The update expression.

Returns

long

The number of updated elements.

See Also