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
typeTypeThe type.
Methods
AddProperty(JsonProperty)
Adds a JsonProperty object.
public void AddProperty(JsonProperty property)
Parameters
propertyJsonPropertyThe 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
propertyNamestringName 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
itemJsonPropertyThe 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
propertyNamestringThe name of the property to get.
comparisonTypeStringComparisonType property name string comparison.
Returns
- JsonProperty
A matching property if found.