Bewerken

Delen via


Utf8JsonWriter.WriteNumber Method

Definition

Overloads

WriteNumber(String, Int32)

Writes a property name specified as a string and an Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(String, Int64)

Writes a property name specified as a string and an Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(String, Single)

Writes a property name specified as a string and a Single value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(String, UInt32)

Writes a property name specified as a string and a UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(String, UInt64)

Writes a property name specified as a string and a UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(JsonEncodedText, Single)

Writes the pre-encoded property name and Single value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(JsonEncodedText, Double)

Writes the pre-encoded property name and Double value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(JsonEncodedText, Int32)

Writes the pre-encoded property name and Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(JsonEncodedText, Int64)

Writes the pre-encoded property name and Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(String, Double)

Writes a property name specified as a string and a Double value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(JsonEncodedText, UInt32)

Writes the pre-encoded property name and UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(JsonEncodedText, Decimal)

Writes the pre-encoded property name and Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(String, Decimal)

Writes a property name specified as a string and a Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(JsonEncodedText, UInt64)

Writes the pre-encoded property name and UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Char>, UInt32)

Writes a property name specified as a read-only character span and a UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Byte>, Decimal)

Writes a property name specified as a read-only span of bytes and a Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Byte>, Double)

Writes a property name specified as a read-only span of bytes and a Double value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Byte>, Int32)

Writes a property name specified as a read-only span of bytes and an Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Byte>, Int64)

Writes a property name specified as a read-only span of bytes and an Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Byte>, Single)

Writes a property name specified as a read-only span of bytes and a Single value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Byte>, UInt32)

Writes a property name specified as a read-only span of bytes and a UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Char>, UInt64)

Writes a property name specified as a read-only character span and a UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Char>, Decimal)

Writes a property name specified as a read-only character span and a Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Char>, Double)

Writes a property name specified as a read-only character span and a Double value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Char>, Int32)

Writes a property name specified as a read-only character span and an Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Char>, Int64)

Writes a property name specified as a read-only character span and an Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Char>, Single)

Writes a property name specified as a read-only character span and a Single value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(ReadOnlySpan<Byte>, UInt64)

Writes a property name specified as a read-only span of bytes and a UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

WriteNumber(String, Int32)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes a property name specified as a string and an Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::String ^ propertyName, int value);
public void WriteNumber (string propertyName, int value);
member this.WriteNumber : string * int -> unit
Public Sub WriteNumber (propertyName As String, value As Integer)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Int32

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

Writes the Int32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(String, Int64)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes a property name specified as a string and an Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::String ^ propertyName, long value);
public void WriteNumber (string propertyName, long value);
member this.WriteNumber : string * int64 -> unit
Public Sub WriteNumber (propertyName As String, value As Long)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Int64

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

Writes the Int64 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(String, Single)

Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs

Writes a property name specified as a string and a Single value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::String ^ propertyName, float value);
public void WriteNumber (string propertyName, float value);
member this.WriteNumber : string * single -> unit
Public Sub WriteNumber (propertyName As String, value As Single)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Single

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

Writes the Single using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G9' on any other framework.

The property name is escaped before writing.

Applies to

WriteNumber(String, UInt32)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes a property name specified as a string and a UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::String ^ propertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (string propertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : string * uint32 -> unit
Public Sub WriteNumber (propertyName As String, value As UInteger)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
UInt32

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

Writes the UInt32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(String, UInt64)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes a property name specified as a string and a UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::String ^ propertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (string propertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : string * uint64 -> unit
Public Sub WriteNumber (propertyName As String, value As ULong)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
UInt64

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

Writes the UInt64 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(JsonEncodedText, Single)

Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs

Writes the pre-encoded property name and Single value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, float value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, float value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * single -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Single)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Single

The value to be written as a JSON number as part of the name/value pair.

Exceptions

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

Writes the Single using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G9' on any other framework.

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to

WriteNumber(JsonEncodedText, Double)

Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs

Writes the pre-encoded property name and Double value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, double value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, double value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * double -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Double)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Double

The value to be written as a JSON number as part of the name/value pair.

Exceptions

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

Writes the Double using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G17' on any other framework.

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to

WriteNumber(JsonEncodedText, Int32)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes the pre-encoded property name and Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, int value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, int value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * int -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Integer)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Int32

The value to be written as a JSON number as part of the name/value pair.

Exceptions

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

Writes the Int32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to

WriteNumber(JsonEncodedText, Int64)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes the pre-encoded property name and Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, long value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, long value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * int64 -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Long)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Int64

The value to be written as a JSON number as part of the name/value pair.

Exceptions

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

Writes the Int64 using the default StandardFormat (this is, 'G'); for example, 32767.

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to

WriteNumber(String, Double)

Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs

Writes a property name specified as a string and a Double value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::String ^ propertyName, double value);
public void WriteNumber (string propertyName, double value);
member this.WriteNumber : string * double -> unit
Public Sub WriteNumber (propertyName As String, value As Double)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Double

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

Writes the Double using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G17' on any other framework.

The property name is escaped before writing.

Applies to

WriteNumber(JsonEncodedText, UInt32)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes the pre-encoded property name and UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : System.Text.Json.JsonEncodedText * uint32 -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As UInteger)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.

value
UInt32

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

Writes the UInt32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to

WriteNumber(JsonEncodedText, Decimal)

Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs

Writes the pre-encoded property name and Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, System::Decimal value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, decimal value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * decimal -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Decimal)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Decimal

The value to be written as a JSON number as part of the name/value pair.

Exceptions

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

Writes the Decimal using the default StandardFormat (that is, 'G').

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to

WriteNumber(String, Decimal)

Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs

Writes a property name specified as a string and a Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::String ^ propertyName, System::Decimal value);
public void WriteNumber (string propertyName, decimal value);
member this.WriteNumber : string * decimal -> unit
Public Sub WriteNumber (propertyName As String, value As Decimal)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Decimal

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

Writes the Decimal using the default StandardFormat (that is, 'G').

The property name is escaped before writing.

Applies to

WriteNumber(JsonEncodedText, UInt64)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes the pre-encoded property name and UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : System.Text.Json.JsonEncodedText * uint64 -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As ULong)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.

value
UInt64

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

Writes the UInt64 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to

WriteNumber(ReadOnlySpan<Char>, UInt32)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes a property name specified as a read-only character span and a UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<char> propertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<char> * uint32 -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As UInteger)

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
UInt32

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the UInt32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Byte>, Decimal)

Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs

Writes a property name specified as a read-only span of bytes and a Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, System::Decimal value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, decimal value);
member this.WriteNumber : ReadOnlySpan<byte> * decimal -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Decimal)

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON object to be written.

value
Decimal

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Decimal using the default StandardFormat (that is, 'G').

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Byte>, Double)

Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs

Writes a property name specified as a read-only span of bytes and a Double value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, double value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, double value);
member this.WriteNumber : ReadOnlySpan<byte> * double -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Double)

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON object to be written.

value
Double

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Double using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G17' on any other framework.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Byte>, Int32)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes a property name specified as a read-only span of bytes and an Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, int value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, int value);
member this.WriteNumber : ReadOnlySpan<byte> * int -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Integer)

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON object to be written.

value
Int32

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Int32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Byte>, Int64)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes a property name specified as a read-only span of bytes and an Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, long value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, long value);
member this.WriteNumber : ReadOnlySpan<byte> * int64 -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Long)

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON object to be written.

value
Int64

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Int64 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Byte>, Single)

Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs

Writes a property name specified as a read-only span of bytes and a Single value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, float value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, float value);
member this.WriteNumber : ReadOnlySpan<byte> * single -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Single)

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON object to be written.

value
Single

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Single using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G9' on any other framework.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Byte>, UInt32)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes a property name specified as a read-only span of bytes and a UInt32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<byte> * uint32 -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As UInteger)

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON object to be written.

value
UInt32

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the UInt32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Char>, UInt64)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes a property name specified as a read-only character span and a UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<char> propertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<char> * uint64 -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As ULong)

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
UInt64

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the UInt64 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Char>, Decimal)

Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs
Source:
Utf8JsonWriter.WriteProperties.Decimal.cs

Writes a property name specified as a read-only character span and a Decimal value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, System::Decimal value);
public void WriteNumber (ReadOnlySpan<char> propertyName, decimal value);
member this.WriteNumber : ReadOnlySpan<char> * decimal -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Decimal)

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Decimal

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Decimal using the default StandardFormat (that is, 'G').

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Char>, Double)

Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs
Source:
Utf8JsonWriter.WriteProperties.Double.cs

Writes a property name specified as a read-only character span and a Double value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, double value);
public void WriteNumber (ReadOnlySpan<char> propertyName, double value);
member this.WriteNumber : ReadOnlySpan<char> * double -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Double)

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Double

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Double using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G17' on any other framework.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Char>, Int32)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes a property name specified as a read-only character span and an Int32 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, int value);
public void WriteNumber (ReadOnlySpan<char> propertyName, int value);
member this.WriteNumber : ReadOnlySpan<char> * int -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Integer)

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Int32

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Int32 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Char>, Int64)

Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

Writes a property name specified as a read-only character span and an Int64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, long value);
public void WriteNumber (ReadOnlySpan<char> propertyName, long value);
member this.WriteNumber : ReadOnlySpan<char> * int64 -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Long)

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Int64

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Int64 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Char>, Single)

Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs
Source:
Utf8JsonWriter.WriteProperties.Float.cs

Writes a property name specified as a read-only character span and a Single value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, float value);
public void WriteNumber (ReadOnlySpan<char> propertyName, float value);
member this.WriteNumber : ReadOnlySpan<char> * single -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Single)

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.

value
Single

The value to be written as a JSON number as part of the name/value pair.

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the Single using the default StandardFormat (that is, 'G') on .NET Core 3.0 or later versions. Uses 'G9' on any other framework.

The property name is escaped before writing.

Applies to

WriteNumber(ReadOnlySpan<Byte>, UInt64)

Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
Source:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

Important

This API is not CLS-compliant.

Writes a property name specified as a read-only span of bytes and a UInt64 value (as a JSON number) as part of a name/value pair of a JSON object.

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<byte> * uint64 -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As ULong)

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON object to be written.

value
UInt64

The value to be written as a JSON number as part of the name/value pair.

Attributes

Exceptions

The specified property name is too large.

Validation is enabled, and the write operation would produce invalid JSON.

Remarks

Writes the UInt64 using the default StandardFormat (that is, 'G'); for example, 32767.

The property name is escaped before writing.

Applies to