JsonSerializer.SerializeToDocument メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
| 名前 | 説明 |
|---|---|
| SerializeToDocument(Object, JsonTypeInfo) |
指定した値を JsonDocumentに変換します。 |
| SerializeToDocument(Object, Type, JsonSerializerOptions) |
指定した値を JsonDocumentに変換します。 |
| SerializeToDocument(Object, Type, JsonSerializerContext) |
指定した値を JsonDocumentに変換します。 |
| SerializeToDocument<TValue>(TValue, JsonSerializerOptions) |
指定した値を JsonDocumentに変換します。 |
| SerializeToDocument<TValue>(TValue, JsonTypeInfo<TValue>) |
指定した値を JsonDocumentに変換します。 |
SerializeToDocument(Object, JsonTypeInfo)
指定した値を 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
パラメーター
- value
- Object
変換する値。
- jsonTypeInfo
- JsonTypeInfo
変換する型に関するメタデータ。
返品
値の JsonDocument 表現。
例外
jsonTypeInfo は nullです。
value が jsonTypeInfoの型と一致しません。
適用対象
SerializeToDocument(Object, Type, JsonSerializerOptions)
指定した値を 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
パラメーター
- value
- Object
変換する値。
- inputType
- Type
変換する value の型。
- options
- JsonSerializerOptions
変換動作を制御するオプション。
返品
値の JsonDocument 表現。
- 属性
例外
inputType と value には互換性がありません。
inputType は nullです。
inputTypeまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。
適用対象
SerializeToDocument(Object, Type, JsonSerializerContext)
指定した値を 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
パラメーター
- value
- Object
変換する値。
- inputType
- Type
変換する value の型。
- context
- JsonSerializerContext
シリアル化可能な型のメタデータ プロバイダー。
返品
値の JsonDocument 表現。
例外
inputTypeまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。
指定されたcontextのGetTypeInfo(Type) メソッドは、変換する型のnullを返します。
inputType または context が null。
適用対象
SerializeToDocument<TValue>(TValue, JsonSerializerOptions)
指定した値を 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
型パラメーター
- TValue
シリアル化する値の型。
パラメーター
- value
- TValue
変換する値。
- options
- JsonSerializerOptions
変換動作を制御するオプション。
返品
JSON 値の JsonDocument 表現。
- 属性
例外
TValueまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。
適用対象
SerializeToDocument<TValue>(TValue, JsonTypeInfo<TValue>)
指定した値を 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
型パラメーター
- TValue
シリアル化する値の型。
パラメーター
- value
- TValue
変換する値。
- jsonTypeInfo
- JsonTypeInfo<TValue>
変換する型に関するメタデータ。
返品
値の JsonDocument 表現。
例外
TValueまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。
jsonTypeInfo は nullです。