Table of Contents

Class JsonPropertyCollection

Namespace
Newtonsoft.Json.Serialization
Assembly
Newtonsoft.Json.dll

A collection of JsonProperty objects.

public class JsonPropertyCollection : KeyedCollection<string, JsonProperty>, IList<JsonProperty>, ICollection<JsonProperty>, IList, ICollection, IReadOnlyList<JsonProperty>, IReadOnlyCollection<JsonProperty>, IEnumerable<JsonProperty>, IEnumerable
Inheritance
JsonPropertyCollection
Implements
Inherited Members

Constructors

JsonPropertyCollection(Type)

Initializes a new instance of the JsonPropertyCollection class.

public JsonPropertyCollection(Type type)

Parameters

type Type

The type.

Methods

AddProperty(JsonProperty)

Adds a JsonProperty object.

public void AddProperty(JsonProperty property)

Parameters

property JsonProperty

The property to add to the collection.

GetClosestMatchProperty(string)

Gets the closest matching JsonProperty object. First attempts to get an exact case match of propertyName and then a case insensitive match.

public JsonProperty GetClosestMatchProperty(string propertyName)

Parameters

propertyName string

Name of the property.

Returns

JsonProperty

A matching property if found.

GetKeyForItem(JsonProperty)

When implemented in a derived class, extracts the key from the specified element.

protected override string GetKeyForItem(JsonProperty item)

Parameters

item JsonProperty

The element from which to extract the key.

Returns

string

The key for the specified element.

GetProperty(string, StringComparison)

Gets a property by property name.

public JsonProperty GetProperty(string propertyName, StringComparison comparisonType)

Parameters

propertyName string

The name of the property to get.

comparisonType StringComparison

Type property name string comparison.

Returns

JsonProperty

A matching property if found.