Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. dynamic bucket = new JObject();
  2. bucket.bucket = "Parking Lot";
  3. bucket.order = new JArray();
  4.  
  5. dynamic issue = new JObject();
  6. dynamic json2 = new JArray(bucket);
  7.  
  8. for(int i =0; i<5; i++) {
  9. issue.title = "Elbow"";
  10. issue.iid = 123;
  11. issue.order = i;
  12. bucket.order.Add(issue);
  13. }
  14.  
  15. Console.WriteLine(json2.ToString());
  16.  
  17. [
  18. {
  19. "bucket": "Parking Lot",
  20. "order": [
  21. {
  22. "title": "Elbow"",
  23. "iid": 123,
  24. "order": 4
  25. },
  26. {
  27. "title": "Elbow"",
  28. "iid": 123,
  29. "order": 1
  30. },
  31. {
  32. "title": "Elbow"",
  33. "iid": 123,
  34. "order": 2
  35. },
  36. {
  37. "title": "Elbow"",
  38. "iid": 123,
  39. "order": 3
  40. },
  41. {
  42. "title": "Elbow"",
  43. "iid": 123,
  44. "order": 4
  45. }
  46. ]
  47. }
  48. ]
  49.  
  50. JArray bucket = new JObject();
  51. bucket.Add("bucket","Parking Lot");
  52. bucket.Add("order", new JArray());
  53.  
  54. JObject issue = new JObject();
  55. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement