Skip to content

SerializationHostingExtensions.AddJsonSerializer(ISerializerBuilder, Func<Type, bool>, JsonSerializerOptions)

AddJsonSerializer(ISerializerBuilder, Func<Type, bool>, JsonSerializerOptions)

staticextension
View source
public static ISerializerBuilder AddJsonSerializer(this ISerializerBuilder serializerBuilder, Func<Type, bool> isSupported, JsonSerializerOptions jsonSerializerOptions = null)
Adds support for serializing and deserializing values using System.Text.Json.JsonSerializer.

Parameters

serializerBuilderISerializerBuilder
The serializer builder.
isSupportedFunc<Type, bool>
A delegate used to indicate which types should be serialized and copied by this codec.
jsonSerializerOptionsJsonSerializerOptions
The JSON serializer options.