コード例 #1
0
        public async Task <IIdentityResult> RemoveUserFromRoleAsync(ApplicationUser user, ApplicationRole role)
        {
            IdentityResult identityResult = await _userManager.RemoveFromRoleAsync(user, role.Name)
                                            .ConfigureAwait(false);

            return(identityResult.ToIIdentityResult());
        }
コード例 #2
0
        public async Task <IIdentityResult> UpdateAsync(ApplicationRole item)
        {
            IdentityResult identityResult = await _roleManager.UpdateAsync(item)
                                            .ConfigureAwait(false);

            return(identityResult.ToIIdentityResult());
        }
コード例 #3
0
        public async Task <IIdentityResult> DeleteAsync(ApplicationUser item)
        {
            IdentityResult identityResult = await _userManager.DeleteAsync(item)
                                            .ConfigureAwait(false);

            return(identityResult.ToIIdentityResult());
        }
コード例 #4
0
        public async Task <IIdentityResult> ChangeUserPasswordAsync(ApplicationUser user, string currentPassword,
                                                                    string newPassword)
        {
            IdentityResult identityResult = await _userManager
                                            .ChangePasswordAsync(user, currentPassword, newPassword)
                                            .ConfigureAwait(false);

            return(identityResult.ToIIdentityResult());
        }