Get TextWriter for Console
1 answer
Use property Console.Out
to get TextWriter
to console like:
var textWriter = Console.Out;
using (var csvWriter = new CsvWriter(textWriter))
{
csvWriter.WriteRecords(records);
textWriter.Flush();
}
+9
source to share