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
TypeThe type.
Methods
AddProperty(JsonProperty)
Adds a JsonProperty object.
public void AddProperty(JsonProperty property)
Parameters
property
JsonPropertyThe 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
stringName 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
JsonPropertyThe 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
stringThe name of the property to get.
comparisonType
StringComparisonType property name string comparison.
Returns
- JsonProperty
A matching property if found.