JsonSerializerOptions Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
JsonSerializerOptions() |
Initializes a new instance of the JsonSerializerOptions class. |
JsonSerializerOptions(JsonSerializerDefaults) |
Constructs a new JsonSerializerOptions instance with a predefined set of options determined by the specified JsonSerializerDefaults. |
JsonSerializerOptions(JsonSerializerOptions) |
Copies the options from a JsonSerializerOptions instance to a new instance. |
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
Initializes a new instance of the JsonSerializerOptions class.
public:
JsonSerializerOptions();
public JsonSerializerOptions();
Public Sub New ()
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
Constructs a new JsonSerializerOptions instance with a predefined set of options determined by the specified JsonSerializerDefaults.
public:
JsonSerializerOptions(System::Text::Json::JsonSerializerDefaults defaults);
public JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults defaults);
new System.Text.Json.JsonSerializerOptions : System.Text.Json.JsonSerializerDefaults -> System.Text.Json.JsonSerializerOptions
Public Sub New (defaults As JsonSerializerDefaults)
Parameters
- defaults
- JsonSerializerDefaults
The JsonSerializerDefaults to reason about.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
- Source:
- JsonSerializerOptions.cs
Copies the options from a JsonSerializerOptions instance to a new instance.
public:
JsonSerializerOptions(System::Text::Json::JsonSerializerOptions ^ options);
public JsonSerializerOptions(System.Text.Json.JsonSerializerOptions options);
new System.Text.Json.JsonSerializerOptions : System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonSerializerOptions
Public Sub New (options As JsonSerializerOptions)
Parameters
- options
- JsonSerializerOptions
The options instance to copy options from.
Exceptions
options
is null
.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: