Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 790 Bytes

JObjectProperties.md

File metadata and controls

30 lines (25 loc) · 790 Bytes

Using JObject.Properties

This sample gets an object's Argon.JProperty collection using Argon.JObject.Properties.

var o = new JObject
{
    {"name1", "value1"},
    {"name2", "value2"}
};

foreach (var property in o.Properties())
{
    Console.WriteLine($"{property.Name} - {property.Value}");
}
// name1 - value1
// name2 - value2

foreach (var property in o)
{
    Console.WriteLine($"{property.Key} - {property.Value}");
}

// name1 - value1
// name2 - value2

snippet source | anchor