using System.Collections.Generic;
public static void Main()
""created"": ""2021-08-01T13:33:37.123Z"",
""ProductName"": ""Coke"",
""ProductName"": ""Fanta"",
""ProductName"": ""Pepsi"",
""OrderName"": ""Beverage"",
""ProductName"": ""Coke"",
StringBuilder csv = new StringBuilder();
using (var r = ChoJSONReader<OrderRoot>.LoadText(json)
using (var w = new ChoCSVWriter(csv)
w.Write(r.SelectMany(root =>
.SelectMany(order => order.OrderArticles
.Select(orderarticle => new
created = root.System.Created,
orderarticle.ProductName,
Console.WriteLine(csv.ToString());
[JsonProperty("created")]
public string Created { get; set; }
public string By { get; set; }
public int Id { get; set; }
[JsonProperty("country")]
public string Country { get; set; }
public class OrderArticle
public int Size { get; set; }
[JsonProperty("ProductName")]
public string ProductName { get; set; }
[JsonProperty("ProductId")]
public string ProductId { get; set; }
[JsonProperty("OrderID")]
public int OrderID { get; set; }
[JsonProperty("OrderName")]
public string OrderName { get; set; }
[JsonProperty("OrderArticles")]
public List<OrderArticle> OrderArticles { get; set; }
[JsonProperty("ProcessedId")]
public int ProcessedId { get; set; }
public string Date { get; set; }
public System System { get; set; }
[JsonProperty("location")]
public Location Location { get; set; }
public List<Order> Orders { get; set; }