JsonSerializer.SerializeToNode Метод

Определение

Перегрузки

Имя Описание
SerializeToNode(Object, JsonTypeInfo)

Преобразует предоставленное значение в JsonNodeобъект.

SerializeToNode(Object, Type, JsonSerializerOptions)

Преобразует предоставленное значение в JsonNodeобъект.

SerializeToNode(Object, Type, JsonSerializerContext)

Преобразует предоставленное значение в JsonNodeобъект.

SerializeToNode<TValue>(TValue, JsonSerializerOptions)

Преобразует предоставленное значение в JsonNodeобъект.

SerializeToNode<TValue>(TValue, JsonTypeInfo<TValue>)

Преобразует предоставленное значение в JsonNodeобъект.

SerializeToNode(Object, JsonTypeInfo)

Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs

Преобразует предоставленное значение в 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

Параметры

value
Object

Преобразуемое значение .

jsonTypeInfo
JsonTypeInfo

Метаданные о преобразуемом типе.

Возвращаемое значение

Представление JsonNode значения.

Исключения

jsonTypeInfo равно null.

value не соответствует типу jsonTypeInfo.

Применяется к

SerializeToNode(Object, Type, JsonSerializerOptions)

Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs

Преобразует предоставленное значение в 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

Параметры

value
Object

Преобразуемое значение .

inputType
Type

Тип преобразуемого value объекта.

options
JsonSerializerOptions

Параметры для управления поведением преобразования.

Возвращаемое значение

Представление JsonNode значения.

Атрибуты

Исключения

inputType несовместим с value.

inputType равно null.

Нет совместимых JsonConverter элементов inputType или его сериализуемых элементов.

Применяется к

SerializeToNode(Object, Type, JsonSerializerContext)

Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs

Преобразует предоставленное значение в 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

Параметры

value
Object

Преобразуемое значение .

inputType
Type

Тип преобразуемого value объекта.

context
JsonSerializerContext

Поставщик метаданных для сериализуемых типов.

Возвращаемое значение

Представление JsonNode значения.

Исключения

Нет совместимых JsonConverter элементов inputType или его сериализуемых элементов.

Метод GetTypeInfo(Type) предоставленного возвращаемого contextnull типа для преобразуемого типа.

inputType или context есть null.

Применяется к

SerializeToNode<TValue>(TValue, JsonSerializerOptions)

Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs

Преобразует предоставленное значение в 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

Параметры типа

TValue

Тип сериализации значения.

Параметры

value
TValue

Преобразуемое значение .

options
JsonSerializerOptions

Параметры для управления поведением преобразования.

Возвращаемое значение

Представление JsonNode значения JSON.

Атрибуты

Исключения

Нет совместимых JsonConverter элементов TValue или его сериализуемых элементов.

Применяется к

SerializeToNode<TValue>(TValue, JsonTypeInfo<TValue>)

Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs
Исходный код:
JsonSerializer.Write.Node.cs

Преобразует предоставленное значение в 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

Параметры типа

TValue

Тип сериализации значения.

Параметры

value
TValue

Преобразуемое значение .

jsonTypeInfo
JsonTypeInfo<TValue>

Метаданные о преобразуемом типе.

Возвращаемое значение

Представление JsonNode значения.

Исключения

Нет совместимых JsonConverter элементов TValue или его сериализуемых элементов.

jsonTypeInfo равно null.

Применяется к