Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }