Show / Hide Table of Contents

Interface IRepository<TEntity>

Inherited Members
IReadOnlyRepository<TEntity>.WithDetails()
IReadOnlyRepository<TEntity>.WithDetails(Expression<Func<TEntity, Object>>[])
IBasicRepository<TEntity>.InsertAsync(TEntity, Boolean, CancellationToken)
IBasicRepository<TEntity>.UpdateAsync(TEntity, Boolean, CancellationToken)
IBasicRepository<TEntity>.DeleteAsync(TEntity, Boolean, CancellationToken)
IReadOnlyBasicRepository<TEntity>.GetListAsync(Boolean, CancellationToken)
IReadOnlyBasicRepository<TEntity>.GetCountAsync(CancellationToken)
IReadOnlyBasicRepository<TEntity>.GetPagedListAsync(Int32, Int32, String, Boolean, CancellationToken)
Namespace: Volo.Abp.Domain.Repositories
Assembly: Volo.Abp.Ddd.Domain.dll
Syntax
public interface IRepository<TEntity> : IReadOnlyRepository<TEntity>, IQueryable<TEntity>, IBasicRepository<TEntity>, IReadOnlyBasicRepository<TEntity>, IRepository where TEntity : class, IEntity
Type Parameters
Name Description
TEntity

Methods

DeleteAsync(Expression<Func<TEntity, Boolean>>, Boolean, CancellationToken)

Deletes many entities by function. Notice that: All entities fits to given predicate are retrieved and deleted. This may cause major performance problems if there are too many entities with given predicate.

Declaration
Task DeleteAsync(Expression<Func<TEntity, bool>> predicate, bool autoSave = false, CancellationToken cancellationToken = null)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

A condition to filter entities

System.Boolean autoSave

Set true to automatically save changes to database. This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database.

CancellationToken cancellationToken

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

Returns
Type Description
Task

FindAsync(Expression<Func<TEntity, Boolean>>, Boolean, CancellationToken)

Get a single entity by the given predicate. It returns null if no entity with the given predicate. It throws if there are multiple entities with the given predicate.

Declaration
Task<TEntity> FindAsync(Expression<Func<TEntity, bool>> predicate, bool includeDetails = true, CancellationToken cancellationToken = null)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

A condition to find the entity

System.Boolean includeDetails

Set true to include all children of this entity

CancellationToken cancellationToken

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

Returns
Type Description
Task<TEntity>

GetAsync(Expression<Func<TEntity, Boolean>>, Boolean, CancellationToken)

Get a single entity by the given predicate. It throws EntityNotFoundException if there is no entity with the given predicate. It throws if there are multiple entities with the given predicate.

Declaration
Task<TEntity> GetAsync(Expression<Func<TEntity, bool>> predicate, bool includeDetails = true, CancellationToken cancellationToken = null)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

A condition to filter entities

System.Boolean includeDetails

Set true to include all children of this entity

CancellationToken cancellationToken

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

Returns
Type Description
Task<TEntity>

Extension Methods

AbpObjectExtensions.As<T>(Object)
AbpObjectExtensions.To<T>(Object)
AbpObjectExtensions.IsIn<T>(T, T[])
AbpObjectExtensions.If<T>(T, Boolean, Func<T, T>)
AbpObjectExtensions.If<T>(T, Boolean, Action<T>)
LockExtensions.Locking(Object, Action)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<TResult>(Object, Func<TResult>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
Back to top Powered by Volosoft