right now , i use /api/identity/roles?SkipCount=0&MaxResultCount=99999 to GetAllRoles when I CreateUser锛宨s where a better way to resolve this? or provider RoleGetAll Api?
CreateUserDto base on IdentityUserCreateOrUpdateDtoBase ,need set the RoleNames
` public abstract class IdentityUserCreateOrUpdateDtoBase
{
......
public bool TwoFactorEnabled { get; set; }
public bool LockoutEnabled { get; set; }
[CanBeNull]
public string[] RoleNames { get; set; }
}`
when chanage user 's role info, also need GetAllUsers Api
Set DefaultMaxResultCount and MaxMaxResultCount in your Application module.
c#
PagedAndSortedResultRequestDto.DefaultMaxResultCount = 99999; // Default: 10
PagedAndSortedResultRequestDto.MaxMaxResultCount = 99999; // Default: 1000
hi @acjh
Sometimes applications need pagination, and they also need to get all the data.
If there is only one GetList method in an application service that supports paging, we should add another GetList method that can get all the data. Or make the paging method support getting all the data.
Passing the MaxResultCount parameter looks bad.
what do you think?
At present, there is a problem with the UI of the identity module. If the number of roles is greater than 10, users cannot be granted some roles.

suggest RoleGetPaged Api add Search Filter parameter, That will be nice
We can also consider making SkipCount and MaxResultCount nullable. This will get all the data.
Or use a separate method.
GetListPagedAsync
@hikalkan what do you think?
@maliming
IMHO, as a ABP user, I can relate to this, it felt strange to have to make up arbitrary numbers (for SkipCount, MaxResultCount) when I really want to retrieve all data while using this endpoint, like:
entity1/GetAll?MaxResultCount=200
entity2/GetAll?MaxResultCount=100
I usually do that when I know there will be only a few items (or rarely used page) for this entity and I will keep them in Angular State anyways, so I don't use server side paging.
If you could make these nullable it would be great!
If you could make these nullable it would be great!
Wait and see @hikalkan idea. : )
Sometimes applications need pagination, and they also need to get all the data.
If there is only one
GetListmethod in an application service that supports paging, we should add anotherGetListmethod that can get all the data. Or make the paging method support getting all the data.
Is there a real case where an application wants to return more than int.MaxValue items?
Otherwise, a large-enough DefaultMaxResultCount already allows to get practically all items.
Passing the
MaxResultCountparameter looks bad.
MaxResultCount is not a required parameter in API calls; it defaults to DefaultMaxResultCount.
@acjh I may be mistaken but, using CrudAppService, passing default PagedResultRequestDto it then inherits the following (screenshow below), with default value of 10, that's why the need to pass MaxResultCount in request

@thiag0coelho Please read both of my earlier comments.
We can also consider making SkipCount and MaxResultCount nullable. This will get all the data.
Or use a separate method.
GetListPagedAsync@hikalkan what do you think?
That will be a breaking change.
Maybe we can add a property IsPageable to CrudAppService, when it set to false, query = ApplyPaging(query, input); in GetListAsync() will be skipped.
We can also consider making SkipCount and MaxResultCount nullable. This will get all the data.
Or use a separate method.GetListPagedAsync@hikalkan what do you think?
That will be a breaking change.
Maybe we can add a property
IsPageableto CrudAppService, when it set to false,query = ApplyPaging(query, input);in GetListAsync() will be skipped.
It's likely to get lost with the IsPageable property when need to query both paged and full list. Separating into GetListAsync / GetListPagedAsync may not be necessary. I think it's better to use nullable MaxResultCount, and apply the take() only when having value.
MaxResultCount can be set with default value, only for full list endpoint we will pass null as MaxResultCount internally
As @acjh stated:
Set DefaultMaxResultCount and MaxMaxResultCount in your Application module.
csharp
PagedAndSortedResultRequestDto.DefaultMaxResultCount = 99999; // Default: 10
PagedAndSortedResultRequestDto.MaxMaxResultCount = int.MaxValue; // Default: 1000
Allowing to getting all data is not a good idea. Most of the real systems intentionally restrict it, because it is open to abuse. Think that a table with millions of rows, would you like to allow a client to get all in one REST call? I don't suppose.
So, it is completely based on the entity type. For roles, no problem to allow to query all, since there will not be too many roles in a system. But it is not good for users and most of the other entity types.
@maliming
At present, there is a problem with the UI of the identity module. If the number of roles is greater than 10, users cannot be granted some roles.
For this particular use case, we can define another method to get roles without paging (I explained why it is not a problem). So, we leave this to developer to add such a method that gets all data without paging.
I created issues, so closing this.