Show / Hide Table of Contents

Class AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>

Inheritance
System.Object
ApplicationService
AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>
AbstractKeyCrudAppService<TEntity, TGetOutputDto, TGetListOutputDto, TKey, TGetListInput, TCreateInput, TUpdateInput>
AbstractKeyReadOnlyAppService<TEntity, TEntityDto, TKey>
AbstractKeyReadOnlyAppService<TEntity, TEntityDto, TKey, TGetListInput>
ReadOnlyAppService<TEntity, TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>
Implements
IAvoidDuplicateCrossCuttingConcerns
IValidationEnabled
IUnitOfWorkEnabled
IAuditingEnabled
ITransientDependency
IReadOnlyAppService<TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>
IApplicationService
IRemoteService
Inherited Members
ApplicationService.ServiceProvider
ApplicationService.ServiceProviderLock
ApplicationService.LazyGetRequiredService<TService>(TService)
ApplicationService.LazyGetRequiredService<TRef>(Type, TRef)
ApplicationService.CommonPostfixes
ApplicationService.AppliedCrossCuttingConcerns
ApplicationService.UnitOfWorkManager
ApplicationService.AsyncExecuter
ApplicationService.ObjectMapperContext
ApplicationService.ObjectMapper
ApplicationService.GuidGenerator
ApplicationService.LoggerFactory
ApplicationService.CurrentTenant
ApplicationService.CurrentUser
ApplicationService.SettingProvider
ApplicationService.Clock
ApplicationService.AuthorizationService
ApplicationService.FeatureChecker
ApplicationService.StringLocalizerFactory
ApplicationService.L
ApplicationService.LocalizationResource
ApplicationService.CurrentUnitOfWork
ApplicationService.Logger
ApplicationService.CheckPolicyAsync(String)
ApplicationService.CreateLocalizer()
Namespace: Volo.Abp.Application.Services
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
Type Name Description
IReadOnlyRepository<TEntity> repository

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
Type Description
IReadOnlyRepository<TEntity>

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
Type Description
Task

CheckGetPolicyAsync()

Declaration
protected virtual Task CheckGetPolicyAsync()
Returns
Type Description
Task

CreateFilteredQuery(TGetListInput)

This method should create based on given input. It should filter query if needed, but should not do sorting or paging. Sorting should be done in ApplySorting(IQueryable<TEntity>, TGetListInput) and paging should be done in ApplyPaging(IQueryable<TEntity>, TGetListInput) methods.

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
Type Description
Task<PagedResultDto<TGetListOutputDto>>

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)

Maps to . It internally calls the MapToGetListOutputDto(TEntity) by default. It can be overriden for custom mapping. Overriding this has higher priority than overriding the MapToGetListOutputDto(TEntity)

Declaration
protected virtual Task<TGetListOutputDto> MapToGetListOutputDtoAsync(TEntity entity)
Parameters
Type Name Description
TEntity entity
Returns
Type Description
Task<TGetListOutputDto>

MapToGetListOutputDtosAsync(List<TEntity>)

Maps a list of to objects. It uses MapToGetListOutputDtoAsync(TEntity) method for each item in the list.

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)

Maps to . It internally calls the MapToGetOutputDto(TEntity) by default. It can be overriden for custom mapping. Overriding this has higher priority than overriding the MapToGetOutputDto(TEntity)

Declaration
protected virtual Task<TGetOutputDto> MapToGetOutputDtoAsync(TEntity entity)
Parameters
Type Name Description
TEntity entity
Returns
Type Description
Task<TGetOutputDto>

Implements

IAvoidDuplicateCrossCuttingConcerns
IValidationEnabled
IUnitOfWorkEnabled
IAuditingEnabled
ITransientDependency
IReadOnlyAppService<TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>
IApplicationService
IRemoteService

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