public void RemoveFromUnconfirmedFriends(User user) { if (!UserFriends.Contains(user)) { throw new Exception($"Cannot remove user {user.Name} from friends list, it does't contains this user "); } UserFriends.Remove(user); }
public void AddFriend(User user) { if (user == null) { throw new Exception("Can not add non existing user to Friend's"); } if (UserFriends.Contains(user)) { throw new Exception($"User {user.Name} with id {user.Id} is alredy on Fiends list"); } UserFriends.Add(user); }