Files
Newtonsoft.Json/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonManually.cs
T
James Newton-King 68eacc480b -JSON Schema fixes
-Fixed static values being included with fields serialization
-Examples! (work in progress)
2013-01-23 21:39:54 +13:00

30 lines
602 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class CreateJsonManually
{
public void Example()
{
JArray array = new JArray();
JValue text = new JValue("Manual text");
JValue date = new JValue(new DateTime(2000, 5, 23));
array.Add(text);
array.Add(date);
string json = array.ToString();
Console.WriteLine(json);
// [
// "Manual text",
// "2000-05-23T00:00:00"
// ]
}
}
}