JsonMetadataServices
Provides helpers to create and initialize metadata for JSON-serializable types.
Returns a JsonConverter<T> instance that converts Boolean values.
Returns a JsonConverter<T> instance that converts byte array values.
Returns a JsonConverter<T> instance that converts Byte values.
Returns a JsonConverter<T> instance that converts Char values.
Returns a JsonConverter<T> instance that converts DateTime values.
Returns a JsonConverter<T> instance that converts DateTimeOffset values.
Returns a JsonConverter<T> instance that converts Decimal values.
Returns a JsonConverter<T> instance that converts Double values.
Returns a JsonConverter<T> instance that converts Guid values.
Returns a JsonConverter<T> instance that converts Int16 values.
Returns a JsonConverter<T> instance that converts Int32 values.
Returns a JsonConverter<T> instance that converts Int64 values.
Returns a JsonConverter<T> instance that converts JsonArray values.
Returns a JsonConverter<T> instance that converts JsonDocument values.
Returns a JsonConverter<T> instance that converts JsonElement values.
Returns a JsonConverter<T> instance that converts JsonNode values.
Returns a JsonConverter<T> instance that converts JsonObject values.
Returns a JsonConverter<T> instance that converts JsonArray values.
Returns a JsonConverter<T> instance that converts Object values.
Returns a JsonConverter<T> instance that converts SByte values.
Returns a JsonConverter<T> instance that converts Single values.
Returns a JsonConverter<T> instance that converts String values.
Returns a JsonConverter<T> instance that converts TimeSpan values.
Returns a JsonConverter<T> instance that converts UInt16 values.
Returns a JsonConverter<T> instance that converts UInt32 values.
Returns a JsonConverter<T> instance that converts UInt64 values.
Returns a JsonConverter<T> instance that converts Uri values.
Returns a JsonConverter<T> instance that converts Version values.
public static JsonTypeInfo<TElement[]> CreateArrayInfo<TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TElement[]> collectionInfo)
Creates serialization metadata for an array.
public static JsonTypeInfo<TCollection> CreateConcurrentQueueInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : ConcurrentQueue<TElement>
Creates serialization metadata for types assignable to Queue<T>.
public static JsonTypeInfo<TCollection> CreateConcurrentStackInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : ConcurrentStack<TElement>
Creates serialization metadata for types assignable to ConcurrentStack<T>.
public static JsonTypeInfo<TCollection> CreateDictionaryInfo<TCollection, TKey, TValue>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : Dictionary<TKey, TValue>
Creates serialization metadata for types assignable to Dictionary<T, U>.
public static JsonTypeInfo<TCollection> CreateIAsyncEnumerableInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IAsyncEnumerable<TElement>
Creates serialization metadata for types assignable to IAsyncEnumerable<T>.
public static JsonTypeInfo<TCollection> CreateICollectionInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : ICollection<TElement>
Creates serialization metadata for types assignable to ICollection<T>.
public static JsonTypeInfo<TCollection> CreateIDictionaryInfo<TCollection, TKey, TValue>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IDictionary<TKey, TValue>
Creates serialization metadata for types assignable to IDictionary<T, U>.
public static JsonTypeInfo<TCollection> CreateIDictionaryInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IDictionary
Creates serialization metadata for types assignable to IDictionary.
public static JsonTypeInfo<TCollection> CreateIEnumerableInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IEnumerable<TElement>
Creates serialization metadata for types assignable to IEnumerable<T>.
public static JsonTypeInfo<TCollection> CreateIEnumerableInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IEnumerable
Creates serialization metadata for types assignable to IList.
public static JsonTypeInfo<TCollection> CreateIListInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IList
Creates serialization metadata for types assignable to IList.
public static JsonTypeInfo<TCollection> CreateIListInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IList<TElement>
Creates serialization metadata for types assignable to IList<T>.
public static JsonTypeInfo<TCollection> CreateImmutableDictionaryInfo<TCollection, TKey, TValue>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo, Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection> createRangeFunc) where TCollection : IReadOnlyDictionary<TKey, TValue>
Creates serialization metadata for ImmutableDictionary<TKey, TValue> and
types assignable to IImmutableDictionary<TKey, TValue>.
public static JsonTypeInfo<TCollection> CreateImmutableEnumerableInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo, Func<IEnumerable<TElement>, TCollection> createRangeFunc) where TCollection : IEnumerable<TElement>
Creates serialization metadata for non-dictionary immutable collection types.
public static JsonTypeInfo<TCollection> CreateIReadOnlyDictionaryInfo<TCollection, TKey, TValue>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IReadOnlyDictionary<TKey, TValue>
Creates serialization metadata for types assignable to IReadOnlyDictionary<T, U>.
public static JsonTypeInfo<TCollection> CreateISetInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : ISet<TElement>
Creates serialization metadata for types assignable to ISet<T>.
public static JsonTypeInfo<TCollection> CreateListInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : List<TElement>
Creates serialization metadata for types assignable to List<T>.
public static JsonTypeInfo<T> CreateObjectInfo<T>(JsonSerializerOptions options, JsonObjectInfoValues<T> objectInfo)
Creates metadata for a complex class or struct.
public static JsonPropertyInfo CreatePropertyInfo<T>(JsonSerializerOptions options, JsonPropertyInfoValues<T> propertyInfo)
Creates metadata for a property or field.
public static JsonTypeInfo<TCollection> CreateQueueInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : Queue<TElement>
Creates serialization metadata for types assignable to Queue<T>.
public static JsonTypeInfo<TCollection> CreateQueueInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo, Action<TCollection, object> addFunc) where TCollection : IEnumerable
Creates serialization metadata for Queue types.
public static JsonTypeInfo<TCollection> CreateStackInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : Stack<TElement>
Creates serialization metadata for types assignable to Stack<T>.
public static JsonTypeInfo<TCollection> CreateStackInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo, Action<TCollection, object> addFunc) where TCollection : IEnumerable
Creates serialization metadata for Stack types.
public static JsonTypeInfo<T> CreateValueInfo<T>(JsonSerializerOptions options, JsonConverter converter)
Creates metadata for a primitive or a type with a custom converter.
public static JsonConverter<T> GetEnumConverter<T>(JsonSerializerOptions options) where T : struct, Enum
Creates a JsonConverter<T> instance that converts T values.
public static JsonConverter<T?> GetNullableConverter<T>(JsonTypeInfo<T> underlyingTypeInfo) where T : struct
Creates a JsonConverter<T> instance that converts T?? values.
public static JsonConverter<T?> GetNullableConverter<T>(JsonSerializerOptions options) where T : struct
Creates a JsonConverter<T> instance that converts T?? values.
Creates a JsonConverter<T> instance that throws NotSupportedException.