JsonSerializerContext(JsonSerializerOptions) Constructor

Definition

Creates an instance of JsonSerializerContext and binds it with the indicated JsonSerializerOptions.

protected JsonSerializerContext (System.Text.Json.JsonSerializerOptions? options);

Parameters

options
JsonSerializerOptions

The run time provided options for the context instance.

Remarks

If no instance options are passed, then no options are set until the context is bound using AddContext<TContext>() or until Options is called, where a new options instance is created and bound.

Applies to

Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)