136
using var xmlWriter = new XmlTextWriter(stringWriter) { Formatting = Formatting.Indented };
1
using System;
2
using System.Collections.Generic;
3
using System.Xml;
4
using System.Xml.Serialization;
5
using System.IO;
6
using System.Linq;
7
using System.Text;
8
using System.Text.Json;
9
10
public class Program
11
{
12
public static void Main()
13
{
14
var exporters = new Dictionary<ExportTypes, IProductsExporter>
15
{
16
{ ExportTypes.Json, new JsonProductsExporter() },
17
{ ExportTypes.Xml, new XmlProductsExporter() },
18
{ ExportTypes.Csv, new CsvProductsExporterAdapter(new CsvHelper(';')) }
19
};
20
21
Console.WriteLine("Please select one:");
22
23
Console.WriteLine(
24
exporters
Cached Result
Please select one:
1. Json
2. Xml
3. Csv
>
1. Json
2. Xml
3. Csv