JsonSerializer.SerializeToElement メソッド

定義

オーバーロード

名前 説明
SerializeToElement(Object, Type, JsonSerializerContext)

指定した値を JsonElementに変換します。

SerializeToElement(Object, Type, JsonSerializerOptions)

指定した値を JsonElementに変換します。

SerializeToElement(Object, JsonTypeInfo)

指定した値を JsonElementに変換します。

SerializeToElement<TValue>(TValue, JsonSerializerOptions)

指定した値を JsonElementに変換します。

SerializeToElement<TValue>(TValue, JsonTypeInfo<TValue>)

指定した値を JsonElementに変換します。

SerializeToElement(Object, Type, JsonSerializerContext)

ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs

指定した値を JsonElementに変換します。

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

パラメーター

value
Object

変換する値。

inputType
Type

変換する value の型。

context
JsonSerializerContext

シリアル化可能な型のメタデータ プロバイダー。

返品

値の JsonElement 表現。

例外

inputTypeまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

指定されたcontextGetTypeInfo(Type) メソッドは、変換する型のnullを返します。

inputType または contextnull

適用対象

SerializeToElement(Object, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs

指定した値を JsonElementに変換します。

[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.JsonElement SerializeToElement(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.JsonElement SerializeToElement(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
public static System.Text.Json.JsonElement SerializeToElement(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 SerializeToElement : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
[<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 SerializeToElement : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
static member SerializeToElement : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
Public Function SerializeToElement (value As Object, inputType As Type, Optional options As JsonSerializerOptions = Nothing) As JsonElement

パラメーター

value
Object

変換する値。

inputType
Type

変換する value の型。

options
JsonSerializerOptions

変換動作を制御するオプション。

返品

値の JsonElement 表現。

属性

例外

inputTypevalue には互換性がありません。

inputTypenullです。

inputTypeまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

適用対象

SerializeToElement(Object, JsonTypeInfo)

ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs

指定した値を JsonElementに変換します。

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

パラメーター

value
Object

変換する値。

jsonTypeInfo
JsonTypeInfo

変換する型に関するメタデータ。

返品

値の JsonElement 表現。

例外

jsonTypeInfonullです。

valuejsonTypeInfoの型と一致しません。

適用対象

SerializeToElement<TValue>(TValue, JsonSerializerOptions)

ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs

指定した値を JsonElementに変換します。

[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.JsonElement SerializeToElement<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.JsonElement SerializeToElement<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
public static System.Text.Json.JsonElement SerializeToElement<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 SerializeToElement : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
[<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 SerializeToElement : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
static member SerializeToElement : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
Public Function SerializeToElement(Of TValue) (value As TValue, Optional options As JsonSerializerOptions = Nothing) As JsonElement

型パラメーター

TValue

シリアル化する値の型。

パラメーター

value
TValue

変換する値。

options
JsonSerializerOptions

変換動作を制御するオプション。

返品

JSON 値の JsonElement 表現。

属性

例外

TValueまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

適用対象

SerializeToElement<TValue>(TValue, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs
ソース:
JsonSerializer.Write.Element.cs

指定した値を JsonElementに変換します。

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

型パラメーター

TValue

シリアル化する値の型。

パラメーター

value
TValue

変換する値。

jsonTypeInfo
JsonTypeInfo<TValue>

変換する型に関するメタデータ。

返品

値の JsonElement 表現。

例外

TValueまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

jsonTypeInfonullです。

適用対象