コード例 #1
0
        public Task <IdentityResult> ChangeUserPasswordAsync(User entity,
                                                             string oldPassword, string newPassword)
        {
            entity.CheckArgumentIsNull(nameof(entity));

            return(_userManager.ChangePasswordAsync(entity, oldPassword, newPassword));
        }
コード例 #2
0
        public async Task <IdentityResult> UpdateUserAsync(User entity, string password)
        {
            entity.CheckArgumentIsNull(nameof(entity));

            if (!String.IsNullOrEmpty(password))
            {
                await RemoveUserPasswordAsync(entity);

                await SetUserPasswordAsync(entity, password);
            }

            return(await UpdateUserInfoAsync(entity));
        }
コード例 #3
0
        public Task <IdentityResult> RemoveUserPasswordAsync(User entity)
        {
            entity.CheckArgumentIsNull(nameof(entity));

            return(_userManager.RemovePasswordAsync(entity));
        }
コード例 #4
0
        public Task <IdentityResult> SetUserPasswordAsync(User entity, string password)
        {
            entity.CheckArgumentIsNull(nameof(entity));

            return(_userManager.AddPasswordAsync(entity, password));
        }
コード例 #5
0
        public Task <IdentityResult> UpdateUserInfoAsync(User entity)
        {
            entity.CheckArgumentIsNull(nameof(entity));

            return(_userManager.UpdateAsync(entity));
        }
コード例 #6
0
        public Task <IdentityResult> DeleteUserAsync(User entity)
        {
            entity.CheckArgumentIsNull(nameof(entity));

            return(_userManager.DeleteAsync(entity));
        }
コード例 #7
0
        public Task <IdentityResult> CreateUserAsync(User entity, string password)
        {
            entity.CheckArgumentIsNull(nameof(entity));

            return(_userManager.CreateAsync(entity, password));
        }