dynamic contact = new ExpandoObject(); contact.Name = "Patrick Hines"; contact.Phone = "206-555-0144"; contact.Address = new ExpandoObject(); contact.Address.Street = "123 Main St"; contact.Address.City = "Mercer Island"; contact.Address.State = "WA"; contact.Address.Postal = "68402"; string res = JsonConvert.SerializeObject(contact);
标签:C#,创建对象,contact,ExpandoObject,Address,new,属性 From: https://www.cnblogs.com/wzf-Learning/p/16954639.html