Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 15, 2016 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/d80f8f78d6074b339d1bc56ebc050146 to your computer and use it in GitHub Desktop.
Save bjoerntx/d80f8f78d6074b339d1bc56ebc050146 to your computer and use it in GitHub Desktop.
List<Invoice> Invoices = new List<Invoice>();
Invoice invoice = new Invoice()
{
Customer = new Customer() {
Name = "Peter Thiel",
City = "Charlotte",
Street = "123 Microsoft Way",
Zip = 22282 },
InvoiceNumber = "I778977622",
Items = new List<Product>()
{
new Product() {
Name = "Product 1",
Description = "Product 1 Description"
},
new Product() {
Name = "Product 2",
Description = "Product 2 Description"
}
}
};
Invoices.Add(invoice);
var json = JsonConvert.SerializeObject(Invoices, Formatting.Indented);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment