Utf8JsonWriter.WriteString Method
Definition
Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Overloads
| Method | Description |
|---|---|
| WriteString(JsonEncodedText, DateTime) | Writes the pre-encoded property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(string, DateTime) | Writes the property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<char>, DateTime) | Writes the property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<byte>, DateTime) | Writes the property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(JsonEncodedText, DateTimeOffset) | Writes the pre-encoded property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(string, DateTimeOffset) | Writes the property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<char>, DateTimeOffset) | Writes the property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<byte>, DateTimeOffset) | Writes the property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(JsonEncodedText, Guid) | Writes the pre-encoded property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(string, Guid) | Writes the property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<char>, Guid) | Writes the property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<byte>, Guid) | Writes the property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(JsonEncodedText, JsonEncodedText) | Writes the pre-encoded property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(string, JsonEncodedText) | Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(string, string) | Writes the property name and string text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<char>, ReadOnlySpan<char>) | Writes the property name and text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<byte>, ReadOnlySpan<byte>) | Writes the UTF-8 property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(JsonEncodedText, string) | Writes the pre-encoded property name and string text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(JsonEncodedText, ReadOnlySpan<char>) | Writes the pre-encoded property name and text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(string, ReadOnlySpan<char>) | Writes the property name and text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<byte>, ReadOnlySpan<char>) | Writes the UTF-8 property name and text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(JsonEncodedText, ReadOnlySpan<byte>) | Writes the pre-encoded property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(string, ReadOnlySpan<byte>) | Writes the property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<char>, ReadOnlySpan<byte>) | Writes the property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<char>, JsonEncodedText) | Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<char>, string) | Writes the property name and string text value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<byte>, JsonEncodedText) | Writes the UTF-8 property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
| WriteString(ReadOnlySpan<byte>, string) | Writes the UTF-8 property name and string text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, DateTime)
Source: Utf8JsonWriter.WriteProperties.DateTime.cs
Writes the pre-encoded property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(JsonEncodedText propertyName, DateTime value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
JsonEncodedText |
The JSON-encoded name of the property to write. |
value |
DateTime |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTime using the round-trip ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000. The property name should already be escaped when the instance of JsonEncodedText was created.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(string, DateTime)
Source: Utf8JsonWriter.WriteProperties.DateTime.cs
Writes the property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(string propertyName, DateTime value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The name of the property to write. |
value |
DateTime |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
ArgumentNullException |
The propertyName parameter is null. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTime using the round-trip ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<char>, DateTime)
Source: Utf8JsonWriter.WriteProperties.DateTime.cs
Writes the property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<char> propertyName, DateTime value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
ReadOnlySpan<char> |
The name of the property to write. |
value |
DateTime |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTime using the round-trip ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<byte>, DateTime)
Source: Utf8JsonWriter.WriteProperties.DateTime.cs
Writes the property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, DateTime value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8PropertyName |
ReadOnlySpan<byte> |
The UTF-8 encoded name of the property to write. |
value |
DateTime |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTime using the round-trip ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(JsonEncodedText, DateTimeOffset)
Source: Utf8JsonWriter.WriteProperties.DateTimeOffset.cs
Writes the pre-encoded property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(JsonEncodedText propertyName, DateTimeOffset value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
JsonEncodedText |
The JSON-encoded name of the property to write. |
value |
DateTimeOffset |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTimeOffset using the round-trippable ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000-07:00.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(string, DateTimeOffset)
Source: Utf8JsonWriter.WriteProperties.DateTimeOffset.cs
Writes the property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(string propertyName, DateTimeOffset value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The name of the property to write. |
value |
DateTimeOffset |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
ArgumentNullException |
The propertyName parameter is null. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTimeOffset using the round-trippable ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000-07:00. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<char>, DateTimeOffset)
Source: Utf8JsonWriter.WriteProperties.DateTimeOffset.cs
Writes the property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<char> propertyName, DateTimeOffset value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
ReadOnlySpan<char> |
The name of the property to write. |
value |
DateTimeOffset |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTimeOffset using the round-trippable ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000-07:00. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<byte>, DateTimeOffset)
Source: Utf8JsonWriter.WriteProperties.DateTimeOffset.cs
Writes the property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, DateTimeOffset value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8PropertyName |
ReadOnlySpan<byte> |
The UTF-8 encoded property name of the JSON object to be written. |
value |
DateTimeOffset |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the DateTimeOffset using the round-trippable ('O') StandardFormat, for example: 2017-06-12T05:30:45.7680000-07:00. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(JsonEncodedText, Guid)
Source: Utf8JsonWriter.WriteProperties.Guid.cs
Writes the pre-encoded property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(JsonEncodedText propertyName, Guid value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
JsonEncodedText |
The JSON-encoded name of the property to write. |
value |
Guid |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(string, Guid)
Source: Utf8JsonWriter.WriteProperties.Guid.cs
Writes the property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(string propertyName, Guid value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The name of the property to write. |
value |
Guid |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
ArgumentNullException |
The propertyName parameter is null. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<char>, Guid)
Source: Utf8JsonWriter.WriteProperties.Guid.cs
Writes the property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<char> propertyName, Guid value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
ReadOnlySpan<char> |
The name of the property to write. |
value |
Guid |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<byte>, Guid)
Source: Utf8JsonWriter.WriteProperties.Guid.cs
Writes the property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, Guid value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8PropertyName |
ReadOnlySpan<byte> |
The UTF-8 encoded name of the property to write. |
value |
Guid |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn. The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(JsonEncodedText, JsonEncodedText)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the pre-encoded property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(JsonEncodedText propertyName, JsonEncodedText value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
JsonEncodedText |
The JSON-encoded name of the property to write. |
value |
JsonEncodedText |
The JSON-encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(string, JsonEncodedText)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(string propertyName, JsonEncodedText value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The JSON-encoded name of the property to write. |
value |
JsonEncodedText |
The JSON-encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
ArgumentNullException |
The propertyName parameter is null. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(string, string)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(string propertyName, string value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The name of the property to write. |
value |
string |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
ArgumentNullException |
The propertyName parameter is null. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value is escaped before writing. If value is null the JSON null value is written, as if WriteNull were called.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<char>, ReadOnlySpan<char>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<char> propertyName, ReadOnlySpan<char> value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
ReadOnlySpan<char> |
The name of the property to write. |
value |
ReadOnlySpan<char> |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the UTF-8 property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<byte> utf8Value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8PropertyName |
ReadOnlySpan<byte> |
The UTF-8 encoded name of the property to write. |
utf8Value |
ReadOnlySpan<byte> |
The UTF-8 encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(JsonEncodedText, string)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the pre-encoded property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(JsonEncodedText propertyName, string value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
JsonEncodedText |
The JSON-encoded name of the property to write. |
value |
string |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The value is escaped before writing. If value is null the JSON null value is written, as if WriteNull was called.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(JsonEncodedText, ReadOnlySpan<char>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the pre-encoded property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(JsonEncodedText propertyName, ReadOnlySpan<char> value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
JsonEncodedText |
The JSON-encoded name of the property to write. |
value |
ReadOnlySpan<char> |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(string, ReadOnlySpan<char>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(string propertyName, ReadOnlySpan<char> value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The name of the property to write. |
value |
ReadOnlySpan<char> |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
ArgumentNullException |
The propertyName parameter is null. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<byte>, ReadOnlySpan<char>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the UTF-8 property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<char> value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8PropertyName |
ReadOnlySpan<byte> |
The UTF-8 encoded name of the property to write. |
value |
ReadOnlySpan<char> |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(JsonEncodedText, ReadOnlySpan<byte>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the pre-encoded property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(JsonEncodedText propertyName, ReadOnlySpan<byte> utf8Value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
JsonEncodedText |
The JSON-encoded name of the property to write. |
utf8Value |
ReadOnlySpan<byte> |
The UTF-8 encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(string, ReadOnlySpan<byte>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(string propertyName, ReadOnlySpan<byte> utf8Value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
string |
The name of the property to write. |
utf8Value |
ReadOnlySpan<byte> |
The UTF-8 encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
ArgumentNullException |
The propertyName parameter is null. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<char>, ReadOnlySpan<byte>)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> utf8Value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
ReadOnlySpan<char> |
The name of the property to write. |
utf8Value |
ReadOnlySpan<byte> |
The UTF-8 encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<char>, JsonEncodedText)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<char> propertyName, JsonEncodedText value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
ReadOnlySpan<char> |
The name of the property to write. |
value |
JsonEncodedText |
The JSON-encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<char>, string)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<char> propertyName, string value)
Parameters
| Name | Type | Description |
|---|---|---|
propertyName |
ReadOnlySpan<char> |
The name of the property to write. |
value |
string |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value are escaped before writing. If value is null the JSON null value is written, as if WriteNull was called.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<byte>, JsonEncodedText)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the UTF-8 property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, JsonEncodedText value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8PropertyName |
ReadOnlySpan<byte> |
The UTF-8 encoded name of the property to write. |
value |
JsonEncodedText |
The JSON-encoded value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name is escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteString(ReadOnlySpan<byte>, string)
Source: Utf8JsonWriter.WriteProperties.String.cs
Writes the UTF-8 property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, string value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8PropertyName |
ReadOnlySpan<byte> |
The UTF-8 encoded name of the property to write. |
value |
string |
The value to write. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified property name or value is too large. |
InvalidOperationException |
Thrown if this would result in invalid JSON being written (while validation is enabled). |
Remarks
The property name and value are escaped before writing. If value is null the JSON null value is written, as if WriteNull was called.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests.
Open an issue