-JSON Schema fixes
-Fixed static values being included with fields serialization -Examples! (work in progress)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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 JObjectProperties
|
||||
{
|
||||
public void Example()
|
||||
{
|
||||
JObject o = new JObject
|
||||
{
|
||||
{ "name1", "value1" },
|
||||
{ "name2", "value2"}
|
||||
};
|
||||
|
||||
foreach (JProperty property in o.Properties())
|
||||
{
|
||||
Console.WriteLine(property.Name + " - " + property.Value);
|
||||
}
|
||||
// name1 - value1
|
||||
// name2 - value2
|
||||
|
||||
foreach (KeyValuePair<string, JToken> property in o)
|
||||
{
|
||||
Console.WriteLine(property.Key + " - " + property.Value);
|
||||
}
|
||||
// name1 - value1
|
||||
// name2 - value2
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user