public bool RemoveThread(string threadToRemove) { if (string.IsNullOrEmpty(threadToRemove)) { return(false); } ClaimsIdentity claimsIdentity = this.User.Identity as ClaimsIdentity; string userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; User onlineUser = this._userService.GetById(userId); // Supprimer dans threads.speakers et dans user.threads bool isRemovedThread = _userService.RemoveThread(threadToRemove, onlineUser.Id); Thread modifiedThread = _threadService.RemoveSpeaker(threadToRemove, onlineUser.Id); if (modifiedThread.Speakers.Length == 0) { _threadService.Delete(modifiedThread); } return(true); // Doit être approfondie }