Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Product product = new Product();
  2.  
  3. product.Name = "Apple";
  4. product.ExpiryDate = new DateTime(2008, 12, 28);
  5. product.Price = 3.99M;
  6. product.Sizes = new string[] { "Small", "Medium", "Large" };
  7.  
  8. string output = JsonConvert.SerializeObject(product);
  9.  
  10. //{
  11. // "Name": "Apple",
  12. // "ExpiryDate": "2008-12-28T00:00:00",
  13. // "Price": 3.99,
  14. // "Sizes": [
  15. // "Small",
  16. // "Medium",
  17. // "Large"
  18. // ]
  19. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement