public List <Movie> GetNotYetFriendsList(Friends Friends, MoviesView contacts) { List <Movie> ContactNotYetFriendsList = new List <Movie>(); List <Movie> FriendsList = GetFriendsList(Friends, contacts); List <Movie> ContactList = contacts.ToList(); foreach (Movie movie in ContactList) { bool isFriend = false; foreach (Movie friend in FriendsList) { if (movie.Id == friend.Id) { isFriend = true; break; } } if (!isFriend) { ContactNotYetFriendsList.Add(contacts.Get(movie.Id).Clone()); } } return(ContactNotYetFriendsList); }
public List <Movie> GetFriendsList(Friends Friends, MoviesView contacts) { List <Movie> ContactFriendsList = new List <Movie>(); List <Friend> FriendsList = Friends.ToList(); foreach (Friend Friend in FriendsList) { if (this.Id == Friend.ContactId) { ContactFriendsList.Add(contacts.Get(Friend.FriendId).Clone()); } } return(ContactFriendsList); }