-Examples!
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
|
||||
{
|
||||
public void Example()
|
||||
{
|
||||
#region Usage
|
||||
JArray array = new JArray();
|
||||
JValue text = new JValue("Manual text");
|
||||
JValue date = new JValue(new DateTime(2000, 5, 23));
|
||||
@@ -17,13 +18,19 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
|
||||
array.Add(text);
|
||||
array.Add(date);
|
||||
|
||||
string json = array.ToString();
|
||||
JObject o = new JObject();
|
||||
o["MyArray"] = array;
|
||||
|
||||
string json = o.ToString();
|
||||
|
||||
Console.WriteLine(json);
|
||||
// [
|
||||
// "Manual text",
|
||||
// "2000-05-23T00:00:00"
|
||||
// ]
|
||||
// {
|
||||
// "MyArray": [
|
||||
// "Manual text",
|
||||
// "2000-05-23T00:00:00"
|
||||
// ]
|
||||
// }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user