Esempio n. 1
0
        public IEnumerable <string> GetKnownAnagrams([FromHeader] string w)
        {
            var anagrams = anagramChecker.GetAnagrams(w);

            if (anagrams.ToList().Count == 0)
            {
                _logger.LogInformation("No anagram found for {0}", w);
                return(null);
            }
            return(anagrams);
        }
        static void GetAnagrams(string word)
        {
            var anagrams = anagramChecker.GetAnagrams(word);

            if (anagrams.ToList().Count == 0)
            {
                Console.WriteLine("No known anagrams found");
            }
            else
            {
                foreach (var anagram in anagrams)
                {
                    Console.WriteLine(anagram);
                }
            }
        }