Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Product product = new Product();
- product.Name = "Apple";
- product.ExpiryDate = new DateTime(2008, 12, 28);
- product.Price = 3.99M;
- product.Sizes = new string[] { "Small", "Medium", "Large" };
- string output = JsonConvert.SerializeObject(product);
- //{
- // "Name": "Apple",
- // "ExpiryDate": "2008-12-28T00:00:00",
- // "Price": 3.99,
- // "Sizes": [
- // "Small",
- // "Medium",
- // "Large"
- // ]
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement