Browse Source

remove int.MaxValue usages for limitedrequestdtos

pull/2478/head
Yunus Emre Kalkan 7 years ago
parent
commit
ec67983c6f
  1. 5
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs
  2. 5
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs
  3. 5
      modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs
  4. 2
      modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserRepository_Tests.cs

5
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs

@ -28,10 +28,7 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users
{ {
UserInfo = new UserInfoViewModel(); UserInfo = new UserInfoViewModel();
var roleDtoList = await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto var roleDtoList = await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto());
{
MaxResultCount = int.MaxValue
});
Roles = ObjectMapper.Map<IReadOnlyList<IdentityRoleDto>, AssignedRoleViewModel[]>(roleDtoList.Items); Roles = ObjectMapper.Map<IReadOnlyList<IdentityRoleDto>, AssignedRoleViewModel[]>(roleDtoList.Items);

5
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs

@ -31,10 +31,7 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users
UserInfo = ObjectMapper.Map<IdentityUserDto, UserInfoViewModel>(await _identityUserAppService.GetAsync(id)); UserInfo = ObjectMapper.Map<IdentityUserDto, UserInfoViewModel>(await _identityUserAppService.GetAsync(id));
Roles = ObjectMapper.Map<IReadOnlyList<IdentityRoleDto>, AssignedRoleViewModel[]>( Roles = ObjectMapper.Map<IReadOnlyList<IdentityRoleDto>, AssignedRoleViewModel[]>(
(await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto (await _identityRoleAppService.GetListAsync(new PagedAndSortedResultRequestDto())).Items
{
MaxResultCount = int.MaxValue
})).Items
); );
var userRoleNames = (await _identityUserAppService.GetRolesAsync(UserInfo.Id)).Items.Select(r => r.Name).ToList(); var userRoleNames = (await _identityUserAppService.GetRolesAsync(UserInfo.Id)).Items.Select(r => r.Name).ToList();

5
modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs

@ -39,10 +39,7 @@ namespace Volo.Abp.Identity
{ {
//Act //Act
var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto());
{
MaxResultCount = int.MaxValue
});
//Assert //Assert

2
modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityUserRepository_Tests.cs

@ -107,7 +107,7 @@ namespace Volo.Abp.Identity
).ShouldBeGreaterThan(0); ).ShouldBeGreaterThan(0);
} }
users = await UserRepository.GetListAsync(null, int.MaxValue, 0, "undefined-username"); users = await UserRepository.GetListAsync(null, 999, 0, "undefined-username");
users.Count.ShouldBe(0); users.Count.ShouldBe(0);
} }

Loading…
Cancel
Save