Method SerializeAsJson
SerializeAsJson(Utf8JsonWriter, JsonOutputOptions)
Writes JSON representation of the value to the stream represented
by Utf8JsonWriter.
Declaration
public override void SerializeAsJson(Utf8JsonWriter writer, JsonOutputOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | The writer to which the value represented by this instance is written. |
JsonOutputOptions | options | (Optional) Options that allow limited
customization of the output. If not specified or null ,
appropriate defaults will be used as described in
JsonOutputOptions. |
Overrides
Remarks
This is an advanced method to optimize performance, using functionality in System.Text.Json namespace. Most applications can use ToJsonString(JsonOutputOptions). See the remarks section of FieldValue on mappings between JSON types and subclasses of FieldValue.
Note that this method writes the value at the current position of the stream represented by Utf8JsonWriter and it does not flush the stream. The state of Utf8JsonWriter should be managed by the caller.