示例#1
0
        public async Task DeleteAsync(string userToDelete, UserAndOrganizationDto userOrg)
        {
            var user = await _usersDbSet
                       .SingleAsync(u => u.Id == userToDelete && u.OrganizationId == userOrg.OrganizationId);

            ClearUserKudos(user);
            await UnassignUserFromWallsAsync(userToDelete, userOrg.OrganizationId);

            await _userManager.RemoveLoginsAsync(userToDelete);

            _usersDbSet.Remove(user);

            await _uow.SaveChangesAsync(userOrg.UserId);
        }