打开 关闭

How to get all the data (bulk) from GetListAsync method in an Application Service? #103


User avatar
0
talhazengin 创建

Abp suite CRUD code generation creates GetListAsync methods in Applications Services, but this method gives paged results.

Is there a way to get all the data with this method without implementing a new GetList method?

Task<PagedResultDto<EntityDto>> GetListAsync(GetEntityInput input)


6 答案
  • User Avatar
    0
    yilmaz.atalar 创建

    Hi,

    You can do that by overriding "ApplyPaging" method of your CrudAppService.

  • User Avatar
    0
    talhazengin 创建

    There is no such method named "ApplyPaging" in abstract class "Volo.Abp.Application.Services.ApplicationService".

  • User Avatar
    0
    yilmaz.atalar 创建

    Is it possible to configure your service to extend CrudAppService? Then you can override ApplyPaging method.

  • User Avatar
    0
    talhazengin 创建

    As far as i can see, things have changed. We used code generation with early 2.* versions. So before this there were only ApplicationService. Anyway our system now uses old mechanism.

  • User Avatar
    0
    yilmaz.atalar 创建

    I've suspected that something is weird. Because abp suite should not generate services by extending ApplicationService class. I think your problem will be easily solved by converting services to extend CrudAppService.

  • User Avatar
    0
    alper 创建
    支持团队 Director

    hi Talha,

    Suite generates only PagedResult action. So if you have a requirement to get all records, you can simply send a big maxResultCount. http://sample.com/api/identity/users?maxResultCount=99999

    Or create a new action to retrieve all records without paging.

Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11