public static bool AlreadyContains(this List <Anagram> words, Anagram anagram) { foreach (var w in words) { if (w.First == anagram.First && w.Second == anagram.Second) { return(true); } } return(false); }