static void Main() { string s; while ((s = Console.ReadLine()) != null) { //Console.WriteLine(s); InputValues.Add(s); } string[] words = InputValues.ToArray(); WriteToCsvFile writeCsvFile = new WriteToCsvFile(); WordAndWordCount wordCount = new WordAndWordCount(); var wordCount2 = wordCount.WordsAndFrequency(words) ?? throw new Exception(); var status = writeCsvFile.RedirectToCsvFile(wordCount2); Console.WriteLine(status); //Console.ReadKey(); }
static void Main() { string s; string status; while ((s = Console.ReadLine()) != null) { //Console.WriteLine(s); inputvalues.Add(s); } string[] words = inputvalues.ToArray(); WriteToCsvFile wtcf = new WriteToCsvFile(); WordAndWordCount wawc = new WordAndWordCount(); Dictionary <String, int> WordCount; WordCount = wawc.WordsAndFrequency(words); status = wtcf.RedirectToCsvFile(WordCount); Console.WriteLine(status); //Console.ReadKey(); }