diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs index b3aa8e43a4..e56e3ff042 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs @@ -63,14 +63,19 @@ public abstract class AbstractKeyReadOnlyAppService(); + var entityDtos = new List(); + + if (totalCount > 0) + { + query = ApplySorting(query, input); + query = ApplyPaging(query, input); - var entities = await AsyncExecuter.ToListAsync(query); - var entityDtos = await MapToGetListOutputDtosAsync(entities); + entities = await AsyncExecuter.ToListAsync(query); + entityDtos = await MapToGetListOutputDtosAsync(entities); + } return new PagedResultDto( totalCount,