JsonSerializer.SerializeToDocument Methode

Definitie

Overloads

Name Description
SerializeToDocument(Object, JsonTypeInfo)

Converteert de opgegeven waarde naar een JsonDocument.

SerializeToDocument(Object, Type, JsonSerializerOptions)

Converteert de opgegeven waarde naar een JsonDocument.

SerializeToDocument(Object, Type, JsonSerializerContext)

Converteert de opgegeven waarde naar een JsonDocument.

SerializeToDocument<TValue>(TValue, JsonSerializerOptions)

Converteert de opgegeven waarde naar een JsonDocument.

SerializeToDocument<TValue>(TValue, JsonTypeInfo<TValue>)

Converteert de opgegeven waarde naar een JsonDocument.

SerializeToDocument(Object, JsonTypeInfo)

Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs

Converteert de opgegeven waarde naar een JsonDocument.

public:
 static System::Text::Json::JsonDocument ^ SerializeToDocument(System::Object ^ value, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static System.Text.Json.JsonDocument SerializeToDocument(object? value, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member SerializeToDocument : obj * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> System.Text.Json.JsonDocument
Public Function SerializeToDocument (value As Object, jsonTypeInfo As JsonTypeInfo) As JsonDocument

Parameters

value
Object

De waarde die moet worden geconverteerd.

jsonTypeInfo
JsonTypeInfo

Metagegevens over het type dat moet worden geconverteerd.

Retouren

Een JsonDocument weergave van de waarde.

Uitzonderingen

jsonTypeInfo is null.

value komt niet overeen met het type jsonTypeInfo.

Van toepassing op

SerializeToDocument(Object, Type, JsonSerializerOptions)

Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs

Converteert de opgegeven waarde naar een JsonDocument.

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Text.Json.JsonDocument SerializeToDocument(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Text.Json.JsonDocument SerializeToDocument(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
public static System.Text.Json.JsonDocument SerializeToDocument(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToDocument : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonDocument
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToDocument : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonDocument
static member SerializeToDocument : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonDocument
Public Function SerializeToDocument (value As Object, inputType As Type, Optional options As JsonSerializerOptions = Nothing) As JsonDocument

Parameters

value
Object

De waarde die moet worden geconverteerd.

inputType
Type

Het type dat value u wilt converteren.

options
JsonSerializerOptions

Opties voor het beheren van het conversiegedrag.

Retouren

Een JsonDocument weergave van de waarde.

Kenmerken

Uitzonderingen

inputType is niet compatibel met value.

inputType is null.

Er is geen compatibel JsonConverter voor inputType of de serialiseerbare leden.

Van toepassing op

SerializeToDocument(Object, Type, JsonSerializerContext)

Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs

Converteert de opgegeven waarde naar een JsonDocument.

public:
 static System::Text::Json::JsonDocument ^ SerializeToDocument(System::Object ^ value, Type ^ inputType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static System.Text.Json.JsonDocument SerializeToDocument(object? value, Type inputType, System.Text.Json.Serialization.JsonSerializerContext context);
static member SerializeToDocument : obj * Type * System.Text.Json.Serialization.JsonSerializerContext -> System.Text.Json.JsonDocument
Public Function SerializeToDocument (value As Object, inputType As Type, context As JsonSerializerContext) As JsonDocument

Parameters

value
Object

De waarde die moet worden geconverteerd.

inputType
Type

Het type dat value u wilt converteren.

context
JsonSerializerContext

Een metagegevensprovider voor serialiseerbare typen.

Retouren

Een JsonDocument weergave van de waarde.

Uitzonderingen

Er is geen compatibel JsonConverter voor inputType of de serialiseerbare leden.

De GetTypeInfo(Type) opgegeven context methode retourneert null het type dat moet worden geconverteerd.

inputType of context is null.

Van toepassing op

SerializeToDocument<TValue>(TValue, JsonSerializerOptions)

Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs

Converteert de opgegeven waarde naar een JsonDocument.

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Text.Json.JsonDocument SerializeToDocument<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Text.Json.JsonDocument SerializeToDocument<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
public static System.Text.Json.JsonDocument SerializeToDocument<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToDocument : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonDocument
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToDocument : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonDocument
static member SerializeToDocument : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonDocument
Public Function SerializeToDocument(Of TValue) (value As TValue, Optional options As JsonSerializerOptions = Nothing) As JsonDocument

Type parameters

TValue

Het type van de waarde dat moet worden geserialiseerd.

Parameters

value
TValue

De waarde die moet worden geconverteerd.

options
JsonSerializerOptions

Opties voor het beheren van het conversiegedrag.

Retouren

Een JsonDocument weergave van de JSON-waarde.

Kenmerken

Uitzonderingen

Er is geen compatibel JsonConverter voor TValue of de serialiseerbare leden.

Van toepassing op

SerializeToDocument<TValue>(TValue, JsonTypeInfo<TValue>)

Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs
Bron:
JsonSerializer.Write.Document.cs

Converteert de opgegeven waarde naar een JsonDocument.

public:
generic <typename TValue>
 static System::Text::Json::JsonDocument ^ SerializeToDocument(TValue value, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static System.Text.Json.JsonDocument SerializeToDocument<TValue>(TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member SerializeToDocument : 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> System.Text.Json.JsonDocument
Public Function SerializeToDocument(Of TValue) (value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue)) As JsonDocument

Type parameters

TValue

Het type van de waarde dat moet worden geserialiseerd.

Parameters

value
TValue

De waarde die moet worden geconverteerd.

jsonTypeInfo
JsonTypeInfo<TValue>

Metagegevens over het type dat moet worden geconverteerd.

Retouren

Een JsonDocument weergave van de waarde.

Uitzonderingen

Er is geen compatibel JsonConverter voor TValue of de serialiseerbare leden.

jsonTypeInfo is null.

Van toepassing op