Table of Contents

Interface IReadRepository<TEntity>

Namespace
Axolotl.EFCore.Repository
Assembly
Axolotl.EFCore.dll
public interface IReadRepository<TEntity> : IReadRepositoryBase<TEntity> where TEntity : class, IAggregateRoot

Type Parameters

TEntity
Inherited Members
Extension Methods

Methods

Find(ISpecification<TEntity>, Expression<Func<TEntity, bool>>)

IEnumerable<TEntity> Find(ISpecification<TEntity> specification, Expression<Func<TEntity, bool>> expression)

Parameters

specification ISpecification<TEntity>
expression Expression<Func<TEntity, bool>>

Returns

IEnumerable<TEntity>

Find(Expression<Func<TEntity, bool>>)

Returns the all element of a sequence, or a default value if the sequence contains no elements.

IEnumerable<TEntity> Find(Expression<Func<TEntity, bool>> expression)

Parameters

expression Expression<Func<TEntity, bool>>

The Linq expression for query.

Returns

IEnumerable<TEntity>

A task that represents the asynchronous operation. The sequence result contains the TEntity, or null.

FirstOrDefaultAsync(CancellationToken)

Returns the first element of a sequence, or a default value if the sequence contains no elements.

Task<TEntity?> FirstOrDefaultAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

Task<TEntity>

A task that represents the asynchronous operation. The task result contains the T??, or null.

GetBySpec(ISpecification<TEntity>, CancellationToken)

Task<IEnumerable<TEntity>> GetBySpec(ISpecification<TEntity> specification, CancellationToken cancellationToken = default)

Parameters

specification ISpecification<TEntity>
cancellationToken CancellationToken

Returns

Task<IEnumerable<TEntity>>

Query(ISpecification<TEntity>, CancellationToken)

Returns the all element of a sequence, or a default value if the sequence contains no elements.

IQueryable<TEntity> Query(ISpecification<TEntity> specification, CancellationToken cancellationToken = default)

Parameters

specification ISpecification<TEntity>

The encapsulated query logic.

cancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

IQueryable<TEntity>

A task that represents the asynchronous operation. The IQueryable result contains the TEntity, or null.

Query(CancellationToken)

Returns the all element of a sequence, or a default value if the sequence contains no elements.

IQueryable<TEntity> Query(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

IQueryable<TEntity>

A task that represents the asynchronous operation. The IQueryable result contains the TEntity, or null.