29 lines
No EOL
902 B
C#
29 lines
No EOL
902 B
C#
using Configuration;
|
|
using DTO;
|
|
using static Configuration.DemoApplicationConfiguration;
|
|
|
|
namespace OrderParser
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
try
|
|
{
|
|
var filesInfoConfig = DemoApplicationConfiguration.InitializeFrom(args);
|
|
var csvFileWriter = new CsvFileWriter(filesInfoConfig.OutputFile);
|
|
|
|
foreach (var jsonFile in filesInfoConfig.JsonFilesInfo)
|
|
{
|
|
var orderModel = new OrderModel(Newtonsoft.Json.JsonConvert.DeserializeObject<OrderDto>(File.ReadAllText(jsonFile.FullName)));
|
|
|
|
csvFileWriter.writeOutRow(orderModel);
|
|
}
|
|
}
|
|
catch (DemoApplicationConfigurationException e)
|
|
{
|
|
Console.WriteLine(e.Message);
|
|
}
|
|
}
|
|
}
|
|
} |