Optimized repositories in readonly application services

pull/4346/head
Necati Meral 5 years ago
parent fba74dba0a
commit a84e31143c

@ -62,6 +62,8 @@ namespace Volo.Abp.Application.Services
ICrudAppService<TGetOutputDto, TGetListOutputDto, TKey, TGetListInput, TCreateInput, TUpdateInput>
where TEntity : class, IEntity
{
protected new IRepository<TEntity> Repository { get; }
protected virtual string CreatePolicyName { get; set; }
protected virtual string UpdatePolicyName { get; set; }
@ -71,7 +73,7 @@ namespace Volo.Abp.Application.Services
protected AbstractKeyCrudAppService(IRepository<TEntity> repository)
: base(repository)
{
Repository = repository;
}
public virtual async Task<TGetOutputDto> CreateAsync(TCreateInput input)

@ -13,7 +13,7 @@ namespace Volo.Abp.Application.Services
: AbstractKeyReadOnlyAppService<TEntity, TEntityDto, TEntityDto, TKey, PagedAndSortedResultRequestDto>
where TEntity : class, IEntity
{
protected AbstractKeyReadOnlyAppService(IRepository<TEntity> repository)
protected AbstractKeyReadOnlyAppService(IReadOnlyRepository<TEntity> repository)
: base(repository)
{
@ -24,7 +24,7 @@ namespace Volo.Abp.Application.Services
: AbstractKeyReadOnlyAppService<TEntity, TEntityDto, TEntityDto, TKey, TGetListInput>
where TEntity : class, IEntity
{
protected AbstractKeyReadOnlyAppService(IRepository<TEntity> repository)
protected AbstractKeyReadOnlyAppService(IReadOnlyRepository<TEntity> repository)
: base(repository)
{
@ -36,13 +36,13 @@ namespace Volo.Abp.Application.Services
, IReadOnlyAppService<TGetOutputDto, TGetListOutputDto, TKey, TGetListInput>
where TEntity : class, IEntity
{
protected IRepository<TEntity> Repository { get; }
protected IReadOnlyRepository<TEntity> Repository { get; }
protected virtual string GetPolicyName { get; set; }
protected virtual string GetListPolicyName { get; set; }
protected AbstractKeyReadOnlyAppService(IRepository<TEntity> repository)
protected AbstractKeyReadOnlyAppService(IReadOnlyRepository<TEntity> repository)
{
Repository = repository;
}

@ -13,7 +13,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected ReadOnlyAppService(IRepository<TEntity, TKey> repository)
protected ReadOnlyAppService(IReadOnlyRepository<TEntity, TKey> repository)
: base(repository)
{
@ -25,7 +25,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected ReadOnlyAppService(IRepository<TEntity, TKey> repository)
protected ReadOnlyAppService(IReadOnlyRepository<TEntity, TKey> repository)
: base(repository)
{
@ -38,9 +38,9 @@ namespace Volo.Abp.Application.Services
where TGetOutputDto : IEntityDto<TKey>
where TGetListOutputDto : IEntityDto<TKey>
{
protected new IRepository<TEntity, TKey> Repository { get; }
protected new IReadOnlyRepository<TEntity, TKey> Repository { get; }
protected ReadOnlyAppService(IRepository<TEntity, TKey> repository)
protected ReadOnlyAppService(IReadOnlyRepository<TEntity, TKey> repository)
: base(repository)
{
Repository = repository;

Loading…
Cancel
Save