Ken H
using System; using Newtonsoft.Json; class Program{
static void Main(string[] args){
string json = "{\"Verson\":\"2014\",\"Product\":[{\"ProductName\":\"Scottish cookies\",\"ProductionPlace\":{\"City\":\"Edinburgh\",\"State\":\"United Kingdom\"},\"Date\":\"14/10/2014\"}]\"}"; ProductInfo des = JsonConvert.DeserializeObject<ProductInfo>(json);
string json = "{\"Verson\":\"2014\",\"Product\":[{\"ProductName\":\"Scottish cookies\",\"ProductionPlace\":{\"City\":\"Edinburgh\",\"State\":\"United Kingdom\"},\"Date\":\"14/10/2014\"}]\"}";
ProductInfo des = JsonConvert.DeserializeObject<ProductInfo>(json);
}
public class ProductInfo {
public ProductInfo() { } public string Verson { get; set; } public string ProductName { get; set; } public Address ProductionPlace { get; set; } public DateTime Date { get; set; }
public ProductInfo() { }
public string Verson { get; set; }
public string ProductName { get; set; }
public Address ProductionPlace { get; set; }
public DateTime Date { get; set; }
public class Address{
public Address() { } public string City { get; set; } public string State { get; set; }
public Address() { }
public string City { get; set; }
public string State { get; set; }