Interface IReadOnlyBasicRepository<TEntity, TKey>
Inherited Members
Namespace: Volo.Abp.Domain.Repositories
Assembly: Volo.Abp.Ddd.Domain.dll
Syntax
public interface IReadOnlyBasicRepository<TEntity, TKey> : IReadOnlyBasicRepository<TEntity>, IRepository where TEntity : class, IEntity<TKey>
Type Parameters
| Name | Description |
|---|---|
| TEntity | |
| TKey |
Methods
FindAsync(TKey, Boolean, CancellationToken)
Gets an entity with given primary key or null if not found.
Declaration
Task<TEntity> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | id | Primary key of the entity to get |
| 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> | Entity or null |
GetAsync(TKey, Boolean, CancellationToken)
Gets an entity with given primary key. Throws EntityNotFoundException if can not find an entity with given id.
Declaration
Task<TEntity> GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | id | Primary key of the entity to get |
| 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> | Entity |