|  |  |  | @ -18,22 +18,22 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users | 
			
		
	
		
			
				
					|  |  |  |  |         [BindProperty] | 
			
		
	
		
			
				
					|  |  |  |  |         public AssignedRoleViewModel[] Roles { get; set; } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         private readonly IIdentityUserAppService _identityUserAppService; | 
			
		
	
		
			
				
					|  |  |  |  |         private readonly IIdentityRoleAppService _identityRoleAppService; | 
			
		
	
		
			
				
					|  |  |  |  |         protected IIdentityUserAppService IdentityUserAppService { get; } | 
			
		
	
		
			
				
					|  |  |  |  |         protected IIdentityRoleAppService IdentityRoleAppService { get; } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         public EditModalModel(IIdentityUserAppService identityUserAppService, IIdentityRoleAppService identityRoleAppService) | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             _identityUserAppService = identityUserAppService; | 
			
		
	
		
			
				
					|  |  |  |  |             _identityRoleAppService = identityRoleAppService; | 
			
		
	
		
			
				
					|  |  |  |  |             IdentityUserAppService = identityUserAppService; | 
			
		
	
		
			
				
					|  |  |  |  |             IdentityRoleAppService = identityRoleAppService; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         public async Task OnGetAsync(Guid id) | 
			
		
	
		
			
				
					|  |  |  |  |         public virtual async Task OnGetAsync(Guid id) | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             UserInfo = ObjectMapper.Map<IdentityUserDto, UserInfoViewModel>(await _identityUserAppService.GetAsync(id)); | 
			
		
	
		
			
				
					|  |  |  |  |             UserInfo = ObjectMapper.Map<IdentityUserDto, UserInfoViewModel>(await IdentityUserAppService.GetAsync(id)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             Roles = ObjectMapper.Map<IReadOnlyList<IdentityRoleDto>, AssignedRoleViewModel[]>((await _identityRoleAppService.GetAllListAsync()).Items); | 
			
		
	
		
			
				
					|  |  |  |  |             Roles = ObjectMapper.Map<IReadOnlyList<IdentityRoleDto>, AssignedRoleViewModel[]>((await IdentityRoleAppService.GetAllListAsync()).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(); | 
			
		
	
		
			
				
					|  |  |  |  |             foreach (var role in Roles) | 
			
		
	
		
			
				
					|  |  |  |  |             { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (userRoleNames.Contains(role.Name)) | 
			
		
	
	
		
			
				
					|  |  |  | @ -43,13 +43,13 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         public async Task<IActionResult> OnPostAsync() | 
			
		
	
		
			
				
					|  |  |  |  |         public virtual async Task<IActionResult> OnPostAsync() | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             ValidateModel(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             var input = ObjectMapper.Map<UserInfoViewModel, IdentityUserUpdateDto>(UserInfo); | 
			
		
	
		
			
				
					|  |  |  |  |             input.RoleNames = Roles.Where(r => r.IsAssigned).Select(r => r.Name).ToArray(); | 
			
		
	
		
			
				
					|  |  |  |  |             await _identityUserAppService.UpdateAsync(UserInfo.Id, input); | 
			
		
	
		
			
				
					|  |  |  |  |             await IdentityUserAppService.UpdateAsync(UserInfo.Id, input); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             return NoContent(); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |