Class JsonSerializerExtensions
Extension methods for the JSON serialization types.
public static class JsonSerializerExtensions
- Inheritance
-
JsonSerializerExtensions
- Inherited Members
Methods
SerializeIntArray(JsonObjectSerializer, string, IEnumerable<int>?, bool)
Serializes an array of integers into the object.
public static void SerializeIntArray(this JsonObjectSerializer serializer, string key, IEnumerable<int>? values, bool includeNullArray = false)
Parameters
serializerJsonObjectSerializerkeystringThe key to serialize the array to
valuesIEnumerable<int>The values in the array
includeNullArrayboolWhether to serialize the array if it's null
SerializeStringArray(JsonObjectSerializer, string, IEnumerable<string?>?, bool)
Serializes an array of strings into the object.
public static void SerializeStringArray(this JsonObjectSerializer serializer, string key, IEnumerable<string?>? values, bool includeNullArray = false)
Parameters
serializerJsonObjectSerializerkeystringThe key to serialize the array to
valuesIEnumerable<string>The values in the array
includeNullArrayboolWhether to serialize the array if it's null
SerializeTraits(JsonObjectSerializer, string, IReadOnlyDictionary<string, IReadOnlyCollection<string>>, bool)
Serialize a trait dictionary value into the object.
public static void SerializeTraits(this JsonObjectSerializer serializer, string key, IReadOnlyDictionary<string, IReadOnlyCollection<string>> dictionary, bool includeEmptyTraits = false)
Parameters
serializerJsonObjectSerializerkeystringThe name of the value
dictionaryIReadOnlyDictionary<string, IReadOnlyCollection<string>>The trait dictionary
includeEmptyTraitsboolA flag to indicate whether to render empty traits