Class AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>
Inheritance
System.Object
AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>
Implements
IAvoidDuplicateCrossCuttingConcerns
IUnitOfWorkEnabled
IAuditingEnabled
ITransientDependency
IRemoteService
Assembly: Volo.Abp.Ddd.Application.dll
Syntax
public abstract class AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGetListOutputDto, TKey, TGetListInput> : ApplicationService, IAvoidDuplicateCrossCuttingConcerns, IValidationEnabled, IUnitOfWorkEnabled, IAuditingEnabled, ITransientDependency, IReadOnlyAppService<TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>, IApplicationService, IRemoteService where TEntity : class, IEntity
Type Parameters
Name |
Description |
TEntity |
|
TGetOutputDto |
|
TGetListOutputDto |
|
TKey |
|
TGetListInput |
|
Constructors
AbstractKeyReadOnlyAppService(IReadOnlyRepository<TEntity>)
Declaration
protected AbstractKeyReadOnlyAppService(IReadOnlyRepository<TEntity> repository)
Parameters
Properties
GetListPolicyName
Declaration
protected virtual string GetListPolicyName { get; set; }
Property Value
Type |
Description |
System.String |
|
GetPolicyName
Declaration
protected virtual string GetPolicyName { get; set; }
Property Value
Type |
Description |
System.String |
|
ReadOnlyRepository
Declaration
protected IReadOnlyRepository<TEntity> ReadOnlyRepository { get; }
Property Value
Methods
ApplyDefaultSorting(IQueryable<TEntity>)
Applies sorting if no sorting specified but a limited result requested.
Declaration
protected virtual IQueryable<TEntity> ApplyDefaultSorting(IQueryable<TEntity> query)
Parameters
Type |
Name |
Description |
IQueryable<TEntity> |
query |
The query.
|
Returns
Type |
Description |
IQueryable<TEntity> |
|
ApplyPaging(IQueryable<TEntity>, TGetListInput)
Should apply paging if needed.
Declaration
protected virtual IQueryable<TEntity> ApplyPaging(IQueryable<TEntity> query, TGetListInput input)
Parameters
Type |
Name |
Description |
IQueryable<TEntity> |
query |
The query.
|
TGetListInput |
input |
The input.
|
Returns
Type |
Description |
IQueryable<TEntity> |
|
ApplySorting(IQueryable<TEntity>, TGetListInput)
Should apply sorting if needed.
Declaration
protected virtual IQueryable<TEntity> ApplySorting(IQueryable<TEntity> query, TGetListInput input)
Parameters
Type |
Name |
Description |
IQueryable<TEntity> |
query |
The query.
|
TGetListInput |
input |
The input.
|
Returns
Type |
Description |
IQueryable<TEntity> |
|
CheckGetListPolicyAsync()
Declaration
protected virtual Task CheckGetListPolicyAsync()
Returns
CheckGetPolicyAsync()
Declaration
protected virtual Task CheckGetPolicyAsync()
Returns
CreateFilteredQuery(TGetListInput)
Declaration
protected virtual IQueryable<TEntity> CreateFilteredQuery(TGetListInput input)
Parameters
Type |
Name |
Description |
TGetListInput |
input |
The input.
|
Returns
Type |
Description |
IQueryable<TEntity> |
|
GetAsync(TKey)
Declaration
public virtual Task<TGetOutputDto> GetAsync(TKey id)
Parameters
Type |
Name |
Description |
TKey |
id |
|
Returns
Type |
Description |
Task<TGetOutputDto> |
|
GetEntityByIdAsync(TKey)
Declaration
protected abstract Task<TEntity> GetEntityByIdAsync(TKey id)
Parameters
Type |
Name |
Description |
TKey |
id |
|
Returns
Type |
Description |
Task<TEntity> |
|
GetListAsync(TGetListInput)
Declaration
public virtual Task<PagedResultDto<TGetListOutputDto>> GetListAsync(TGetListInput input)
Parameters
Type |
Name |
Description |
TGetListInput |
input |
|
Returns
MapToGetListOutputDto(TEntity)
Maps to .
It uses IObjectMapper by default.
It can be overriden for custom mapping.
Declaration
protected virtual TGetListOutputDto MapToGetListOutputDto(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Returns
Type |
Description |
TGetListOutputDto |
|
MapToGetListOutputDtoAsync(TEntity)
Declaration
protected virtual Task<TGetListOutputDto> MapToGetListOutputDtoAsync(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Returns
Type |
Description |
Task<TGetListOutputDto> |
|
MapToGetListOutputDtosAsync(List<TEntity>)
Declaration
protected virtual Task<List<TGetListOutputDto>> MapToGetListOutputDtosAsync(List<TEntity> entities)
Parameters
Type |
Name |
Description |
List<TEntity> |
entities |
|
Returns
Type |
Description |
Task<List<TGetListOutputDto>> |
|
MapToGetOutputDto(TEntity)
Maps to .
It uses IObjectMapper by default.
It can be overriden for custom mapping.
Declaration
protected virtual TGetOutputDto MapToGetOutputDto(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Returns
Type |
Description |
TGetOutputDto |
|
MapToGetOutputDtoAsync(TEntity)
Declaration
protected virtual Task<TGetOutputDto> MapToGetOutputDtoAsync(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
Returns
Type |
Description |
Task<TGetOutputDto> |
|
Implements
IAvoidDuplicateCrossCuttingConcerns
IUnitOfWorkEnabled
IAuditingEnabled
ITransientDependency
IRemoteService
Extension Methods