# SerializationHostingExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization.systemtextjson/orleans.serialization.serializationhostingextensions/)

## AddJsonSerializer(ISerializerBuilder, Func&lt;Type, bool&gt;, Func&lt;Type, bool&gt;, Action&lt;OptionsBuilder&lt;JsonCodecOptions&gt;&gt;) {#addjsonserializer-this-orleans-serialization-iserializerbuilder-system-func-syst-b0cf492a}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.systemtextjson/orleans.serialization.serializationhostingextensions/methods/addjsonserializer-this-orleans-serialization-iserializerbuilder-system-func-syst-b0cf492a/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization.SystemTextJson/SerializationHostingExtensions.cs#L53-L86)

```csharp
public static ISerializerBuilder AddJsonSerializer(this ISerializerBuilder serializerBuilder, Func<Type, bool> isSerializable, Func<Type, bool> isCopyable, Action<OptionsBuilder<JsonCodecOptions>> configureOptions = null)
```

Adds support for serializing and deserializing values using `System.Text.Json.JsonSerializer`.

### Parameters

- `serializerBuilder` (`ISerializerBuilder`): The serializer builder.
- `isSerializable` (`Func<Type, bool>`): A delegate used to indicate which types should be serialized by this codec.
- `isCopyable` (`Func<Type, bool>`): A delegate used to indicate which types should be copied by this codec.
- `configureOptions` (`Action<OptionsBuilder<JsonCodecOptions>>`): A delegate used to configure the options for the JSON serializer.

## AddJsonSerializer(ISerializerBuilder, Func&lt;Type, bool&gt;, JsonSerializerOptions) {#addjsonserializer-this-orleans-serialization-iserializerbuilder-system-func-syst-b5e50b87}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.systemtextjson/orleans.serialization.serializationhostingextensions/methods/addjsonserializer-this-orleans-serialization-iserializerbuilder-system-func-syst-b5e50b87/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization.SystemTextJson/SerializationHostingExtensions.cs#L29-L38)

```csharp
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

- `serializerBuilder` (`ISerializerBuilder`): The serializer builder.
- `isSupported` (`Func<Type, bool>`): A delegate used to indicate which types should be serialized and copied by this codec.
- `jsonSerializerOptions` (`JsonSerializerOptions`): The JSON serializer options.
