JsonSerializer.SerializeToNode Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Overloads
| Name | Description |
|---|---|
| SerializeToNode(Object, JsonTypeInfo) |
Converteert de opgegeven waarde naar een JsonNode. |
| SerializeToNode(Object, Type, JsonSerializerOptions) |
Converteert de opgegeven waarde naar een JsonNode. |
| SerializeToNode(Object, Type, JsonSerializerContext) |
Converteert de opgegeven waarde naar een JsonNode. |
| SerializeToNode<TValue>(TValue, JsonSerializerOptions) |
Converteert de opgegeven waarde naar een JsonNode. |
| SerializeToNode<TValue>(TValue, JsonTypeInfo<TValue>) |
Converteert de opgegeven waarde naar een JsonNode. |
SerializeToNode(Object, JsonTypeInfo)
Converteert de opgegeven waarde naar een JsonNode.
public:
static System::Text::Json::Nodes::JsonNode ^ SerializeToNode(System::Object ^ value, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static System.Text.Json.Nodes.JsonNode? SerializeToNode(object? value, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member SerializeToNode : obj * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> System.Text.Json.Nodes.JsonNode
Public Function SerializeToNode (value As Object, jsonTypeInfo As JsonTypeInfo) As JsonNode
Parameters
- value
- Object
De waarde die moet worden geconverteerd.
- jsonTypeInfo
- JsonTypeInfo
Metagegevens over het type dat moet worden geconverteerd.
Retouren
Een JsonNode weergave van de waarde.
Uitzonderingen
jsonTypeInfo is null.
value komt niet overeen met het type jsonTypeInfo.
Van toepassing op
SerializeToNode(Object, Type, JsonSerializerOptions)
Converteert de opgegeven waarde naar een JsonNode.
[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.Nodes.JsonNode? SerializeToNode(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.Nodes.JsonNode? SerializeToNode(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
public static System.Text.Json.Nodes.JsonNode? SerializeToNode(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 SerializeToNode : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Nodes.JsonNode
[<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 SerializeToNode : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Nodes.JsonNode
static member SerializeToNode : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Nodes.JsonNode
Public Function SerializeToNode (value As Object, inputType As Type, Optional options As JsonSerializerOptions = Nothing) As JsonNode
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 JsonNode 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
SerializeToNode(Object, Type, JsonSerializerContext)
Converteert de opgegeven waarde naar een JsonNode.
public:
static System::Text::Json::Nodes::JsonNode ^ SerializeToNode(System::Object ^ value, Type ^ inputType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static System.Text.Json.Nodes.JsonNode? SerializeToNode(object? value, Type inputType, System.Text.Json.Serialization.JsonSerializerContext context);
static member SerializeToNode : obj * Type * System.Text.Json.Serialization.JsonSerializerContext -> System.Text.Json.Nodes.JsonNode
Public Function SerializeToNode (value As Object, inputType As Type, context As JsonSerializerContext) As JsonNode
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 JsonNode 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
SerializeToNode<TValue>(TValue, JsonSerializerOptions)
Converteert de opgegeven waarde naar een JsonNode.
[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.Nodes.JsonNode? SerializeToNode<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.Nodes.JsonNode? SerializeToNode<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
public static System.Text.Json.Nodes.JsonNode? SerializeToNode<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 SerializeToNode : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Nodes.JsonNode
[<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 SerializeToNode : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Nodes.JsonNode
static member SerializeToNode : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Nodes.JsonNode
Public Function SerializeToNode(Of TValue) (value As TValue, Optional options As JsonSerializerOptions = Nothing) As JsonNode
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 JsonNode weergave van de JSON-waarde.
- Kenmerken
Uitzonderingen
Er is geen compatibel JsonConverter voor TValue of de serialiseerbare leden.
Van toepassing op
SerializeToNode<TValue>(TValue, JsonTypeInfo<TValue>)
Converteert de opgegeven waarde naar een JsonNode.
public:
generic <typename TValue>
static System::Text::Json::Nodes::JsonNode ^ SerializeToNode(TValue value, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static System.Text.Json.Nodes.JsonNode? SerializeToNode<TValue>(TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member SerializeToNode : 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> System.Text.Json.Nodes.JsonNode
Public Function SerializeToNode(Of TValue) (value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue)) As JsonNode
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 JsonNode weergave van de waarde.
Uitzonderingen
Er is geen compatibel JsonConverter voor TValue of de serialiseerbare leden.
jsonTypeInfo is null.