I created model like this (in separate file MMproducts.cs inside project):
public class Product
{
public string sku { get; set; }
}
public class Order
{
public int id { get; set; }
public List<Product> products { get; set; }
}
public class Root
{
public string status { get; set; }
public List<Order> orders { get; set; }
}
How to Console.WriteLine
all Products sku?
This model translate json data. To access to 'first' level of list i used:
MMproducts mmResponse = JsonConvert.DeserializeObject<MMproducts> (response.Content);
foreach (var defindex in mmResponse.orders) { }
but i don't know how to use this metod to print sku.