JsonMetadataServices
Provides helpers to create and initialize metadata for JSON-serializable types.
Gets an object that converts Boolean values.
Gets an object that converts byte array values.
Gets an object that converts Byte values.
Gets an object that converts Char values.
Gets an object that converts DateTime values.
Gets an object that converts DateTimeOffset values.
Gets an object that converts Decimal values.
Gets an object that converts Double values.
Gets an object that converts Guid values.
Gets an object that converts Int16 values.
Gets an object that converts Int32 values.
Gets an object that converts Int64 values.
Gets an object that converts JsonArray values.
Returns a JsonConverter<T> instance that converts JsonDocument values.
Gets a JSON converter that converts JsonElement values.
Gets an object that converts JsonNode values.
Gets an object that converts JsonObject values.
Gets an object that converts JsonValue values.
Gets an object that converts Object values.
Gets an object that converts SByte values.
Gets an object that converts Single values.
Gets an object that converts String values.
Gets a JSON converter that converts TimeSpan values.
Gets an object that converts UInt16 values.
Gets an object that converts UInt32 values.
Gets an object that converts UInt64 values.
Gets an object that converts Uri values.
Gets an object 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 metadata for types assignable to ConcurrentQueue<T>.
public static JsonTypeInfo<TCollection> CreateConcurrentStackInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : ConcurrentStack<TElement>
Creates 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 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 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 metadata for types assignable to IDictionary<T, U>.
public static JsonTypeInfo<TCollection> CreateIDictionaryInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IDictionary
Creates metadata for types assignable to IDictionary.
public static JsonTypeInfo<TCollection> CreateIEnumerableInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IEnumerable<TElement>
Creates metadata for types assignable to IEnumerable<T>.
public static JsonTypeInfo<TCollection> CreateIEnumerableInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IEnumerable
Creates metadata for types assignable to IEnumerable.
public static JsonTypeInfo<TCollection> CreateIListInfo<TCollection>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IList
Creates metadata for types assignable to IList.
public static JsonTypeInfo<TCollection> CreateIListInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : IList<TElement>
Creates 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 metadata for ImmutableDictionary<T, U> and types assignable to IReadOnlyDictionary<T, U>.
public static JsonTypeInfo<TCollection> CreateImmutableEnumerableInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo, Func<IEnumerable<TElement>, TCollection> createRangeFunc) where TCollection : IEnumerable<TElement>
Creates 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 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 metadata for types assignable to ISet<T>.
public static JsonTypeInfo<TCollection> CreateListInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : List<TElement>
Creates 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 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 metadata for types assignable to Queue.
public static JsonTypeInfo<TCollection> CreateStackInfo<TCollection, TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : Stack<TElement>
Creates 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 metadata for types assignable to Stack.
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
Gets a type converter that throws a NotSupportedException.