public async Task DeleteFriend(UserProfile friendToDelete) { try { if (friendToDelete == null) { throw new ArgumentNullException(nameof(friendToDelete)); } var userLogued = await this._identityService.GetUserLoguedAsync(); await _friendsRepository.DeleteFriendAsync(userLogued.Id, friendToDelete.Id); var request = await _friendRequestRepository.GetByUsersIdAsync(userLogued.Id, friendToDelete.Id); request.Status = FriendRequestStatusEnum.DeletedFriend; request.DateDeletedFriend = DateTime.Now; await _friendRequestRepository.SaveAsync(request); } catch (Exception e) { await _loggerService.LogErrorAsync(e); throw; } }