JsonSerializer.Deserialize メソッド

定義

オーバーロード

名前 説明
Deserialize(Stream, JsonTypeInfo)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを、 jsonTypeInfoで指定されたインスタンスに読み取ります。 Stream は読み取って完了します。

Deserialize(Utf8JsonReader, Type, JsonSerializerContext)

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を returnTypeに読み取ります。

Deserialize(Utf8JsonReader, Type, JsonSerializerOptions)

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を読み取り、それを指定した型のインスタンスに変換します。

Deserialize(JsonNode, Type, JsonSerializerContext)

1 つの JSON 値を表す JsonNodereturnTypeに変換します。

Deserialize(JsonNode, Type, JsonSerializerOptions)

1 つの JSON 値を表す JsonNodereturnTypeに変換します。

Deserialize(JsonElement, Type, JsonSerializerContext)

1 つの JSON 値を表す JsonElementreturnTypeに変換します。

Deserialize(JsonElement, Type, JsonSerializerOptions)

1 つの JSON 値を表す JsonElementreturnTypeに変換します。

Deserialize(JsonDocument, Type, JsonSerializerContext)

1 つの JSON 値を表す JsonDocumentreturnTypeに変換します。

Deserialize(JsonDocument, Type, JsonSerializerOptions)

1 つの JSON 値を表す JsonDocumentreturnTypeに変換します。

Deserialize(String, Type, JsonSerializerOptions)

1 つの JSON 値を表すテキストを、指定した型のインスタンスに解析します。

Deserialize(ReadOnlySpan<Char>, Type, JsonSerializerContext)

1 つの JSON 値を表すテキストを returnTypeに解析します。

Deserialize(ReadOnlySpan<Char>, Type, JsonSerializerOptions)

1 つの JSON 値を表すテキストを、指定した型のインスタンスに解析します。

Deserialize(String, Type, JsonSerializerContext)

1 つの JSON 値を表すテキストを returnTypeに解析します。

Deserialize(ReadOnlySpan<Byte>, Type, JsonSerializerOptions)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを、指定した型のインスタンスに解析します。

Deserialize(ReadOnlySpan<Byte>, JsonTypeInfo)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを、 jsonTypeInfoで指定されたインスタンスに解析します。

Deserialize(ReadOnlySpan<Byte>, Type, JsonSerializerContext)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを returnTypeに解析します。

Deserialize(String, JsonTypeInfo)

1 つの JSON 値を表すテキストを、 jsonTypeInfoで指定されたインスタンスに解析します。

Deserialize(JsonDocument, JsonTypeInfo)

1 つの JSON 値を表す JsonDocument を、 jsonTypeInfoで指定されたインスタンスに変換します。

Deserialize(JsonElement, JsonTypeInfo)

1 つの JSON 値を表す JsonElement を、 jsonTypeInfoで指定されたインスタンスに変換します。

Deserialize(ReadOnlySpan<Char>, JsonTypeInfo)

1 つの JSON 値を表すテキストを、 jsonTypeInfoで指定されたインスタンスに解析します。

Deserialize(Utf8JsonReader, JsonTypeInfo)

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を、 jsonTypeInfoで指定されたインスタンスに読み取ります。

Deserialize(Stream, Type, JsonSerializerOptions)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを returnTypeに読み取ります。 Stream は読み取って完了します。

Deserialize(Stream, Type, JsonSerializerContext)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを returnTypeに読み取ります。 Stream は読み取って完了します。

Deserialize(JsonNode, JsonTypeInfo)

1 つの JSON 値を表す JsonNode を、 jsonTypeInfoで指定されたインスタンスに変換します。

Deserialize<TValue>(JsonDocument, JsonTypeInfo<TValue>)

1 つの JSON 値を表す JsonDocumentTValueに変換します。

Deserialize<TValue>(Utf8JsonReader, JsonTypeInfo<TValue>)

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を TValueに読み取ります。

Deserialize<TValue>(Utf8JsonReader, JsonSerializerOptions)

指定されたリーダーから、ジェネリック型パラメーターで指定された型のインスタンスに 1 つの JSON 値 (オブジェクトまたは配列を含む) を読み取ります。

Deserialize<TValue>(JsonNode, JsonTypeInfo<TValue>)

1 つの JSON 値を表す JsonNodeTValueに変換します。

Deserialize<TValue>(JsonNode, JsonSerializerOptions)

1 つの JSON 値を表す JsonNodeTValueに変換します。

Deserialize<TValue>(JsonElement, JsonTypeInfo<TValue>)

1 つの JSON 値を表す JsonElementTValueに変換します。

Deserialize<TValue>(JsonElement, JsonSerializerOptions)

1 つの JSON 値を表す JsonElementTValueに変換します。

Deserialize<TValue>(JsonDocument, JsonSerializerOptions)

1 つの JSON 値を表す JsonDocumentTValueに変換します。

Deserialize<TValue>(ReadOnlySpan<Byte>, JsonSerializerOptions)

単一の JSON 値を表す UTF-8 でエンコードされたテキストを、ジェネリック型パラメーターで指定された型のインスタンスに解析します。

Deserialize<TValue>(String, JsonSerializerOptions)

単一の JSON 値を表すテキストを、ジェネリック型パラメーターで指定された型のインスタンスに解析します。

Deserialize<TValue>(ReadOnlySpan<Char>, JsonTypeInfo<TValue>)

1 つの JSON 値を表すテキストを TValueに解析します。

Deserialize<TValue>(ReadOnlySpan<Char>, JsonSerializerOptions)

単一の JSON 値を表すテキストを、ジェネリック型パラメーターで指定された型のインスタンスに解析します。

Deserialize<TValue>(ReadOnlySpan<Byte>, JsonTypeInfo<TValue>)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを TValueに解析します。

Deserialize<TValue>(Stream, JsonTypeInfo<TValue>)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを TValueに読み取ります。 Stream は読み取って完了します。

Deserialize<TValue>(Stream, JsonSerializerOptions)

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを TValueに読み取ります。 Stream は読み取って完了します。

Deserialize<TValue>(String, JsonTypeInfo<TValue>)

1 つの JSON 値を表すテキストを TValueに解析します。

Deserialize(Stream, JsonTypeInfo)

ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを、 jsonTypeInfoで指定されたインスタンスに読み取ります。 Stream は読み取って完了します。

public:
 static System::Object ^ Deserialize(System::IO::Stream ^ utf8Json, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(System.IO.Stream utf8Json, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : System.IO.Stream * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
Public Function Deserialize (utf8Json As Stream, jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

utf8Json
Stream

解析する JSON データ。

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

utf8Json または jsonTypeInfonull

JSON が無効であるか、ストリームに残りのデータがあります。

適用対象

Deserialize(Utf8JsonReader, Type, JsonSerializerContext)

ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を returnTypeに読み取ります。

public:
 static System::Object ^ Deserialize(System::Text::Json::Utf8JsonReader % reader, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(ref System.Text.Json.Utf8JsonReader reader, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : Utf8JsonReader * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
Public Function Deserialize (ByRef reader As Utf8JsonReader, returnType As Type, context As JsonSerializerContext) As Object

パラメーター

reader
Utf8JsonReader

読み取るリーダー。

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

returnType または contextnull

JSON が無効であるか、 returnType が JSON と互換性がない、または値をリーダーから読み取れませんでした。

reader はサポートされていないオプションを使用しています。

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

指定されたcontextGetTypeInfo(Type) メソッドは、returnTypeの互換性のあるJsonTypeInfoを返しませんでした。

注釈

readerTokenType プロパティがPropertyNameまたはNoneの場合、リーダーは 1 回の呼び出しで値の開始を決定するためにRead()されます。

このメソッドが完了すると、 reader は JSON 値の最後のトークンに配置されます。 例外がスローされた場合、リーダーはメソッドが呼び出されたときの状態にリセットされます。

このメソッドは、リーダーが操作したデータのコピーを作成するため、このメソッドの戻り値を超えてデータの整合性を維持する呼び出し元の要件はありません。

Utf8JsonReaderのインスタンスの作成に使用されるJsonReaderOptionsは、競合時にJsonSerializerOptionsよりも優先されます。 したがって、 AllowTrailingCommasMaxDepth、および CommentHandling は読み取り中に使用されます。

適用対象

Deserialize(Utf8JsonReader, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を読み取り、それを指定した型のインスタンスに変換します。

[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 object? Deserialize(ref System.Text.Json.Utf8JsonReader reader, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object? Deserialize(ref System.Text.Json.Utf8JsonReader reader, Type returnType, 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 object? Deserialize(ref System.Text.Json.Utf8JsonReader reader, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object Deserialize(ref System.Text.Json.Utf8JsonReader reader, Type returnType, 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 Deserialize : Utf8JsonReader * Type * System.Text.Json.JsonSerializerOptions -> obj
static member Deserialize : Utf8JsonReader * Type * System.Text.Json.JsonSerializerOptions -> obj
[<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 Deserialize : Utf8JsonReader * Type * System.Text.Json.JsonSerializerOptions -> obj
Public Function Deserialize (ByRef reader As Utf8JsonReader, returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object
Public Shared Function Deserialize (ByRef reader As Utf8JsonReader, returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object

パラメーター

reader
Utf8JsonReader

JSON を読み取るリーダー。

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

読み取り中にシリアライザーの動作を制御するオプション。

返品

JSON 値の returnType 表現。

属性

例外

returnTypenullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

値をリーダーから読み取れませんでした。

reader はサポートされていないオプションを使用しています。

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

注釈

readerTokenType プロパティがJsonTokenType.PropertyNameまたはJsonTokenType.Noneの場合、リーダーは 1 回の呼び出しで値の開始を決定するためにUtf8JsonReader.Read()されます。

このメソッドが完了すると、 reader は JSON 値の最後のトークンに配置されます。 例外がスローされた場合、リーダーはメソッドが呼び出されたときの状態にリセットされます。

このメソッドは、リーダーが操作したデータのコピーを作成するため、このメソッドの戻り値を超えてデータの整合性を維持する呼び出し元の要件はありません。

Utf8JsonReaderのインスタンスの作成に使用されるJsonReaderOptionsは、競合時にJsonSerializerOptionsよりも優先されます。 したがって、 JsonReaderOptions.AllowTrailingCommasJsonReaderOptions.MaxDepth、および JsonReaderOptions.CommentHandling は読み取り中に使用されます。

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

Deserialize(JsonNode, Type, JsonSerializerContext)

ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs

1 つの JSON 値を表す JsonNodereturnTypeに変換します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Deserialize(System::Text::Json::Nodes::JsonNode ^ node, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(this System.Text.Json.Nodes.JsonNode? node, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : System.Text.Json.Nodes.JsonNode * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
<Extension()>
Public Function Deserialize (node As JsonNode, returnType As Type, context As JsonSerializerContext) As Object

パラメーター

node
JsonNode

変換する JsonNode

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

returnTypenullです。

-又は-

contextnullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

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

適用対象

Deserialize(JsonNode, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs

1 つの JSON 値を表す JsonNodereturnTypeに変換します。

[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 object? Deserialize(this System.Text.Json.Nodes.JsonNode? node, Type returnType, 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 object? Deserialize(this System.Text.Json.Nodes.JsonNode? node, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object? Deserialize(this System.Text.Json.Nodes.JsonNode? node, Type returnType, 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 Deserialize : System.Text.Json.Nodes.JsonNode * Type * System.Text.Json.JsonSerializerOptions -> obj
[<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 Deserialize : System.Text.Json.Nodes.JsonNode * Type * System.Text.Json.JsonSerializerOptions -> obj
static member Deserialize : System.Text.Json.Nodes.JsonNode * Type * System.Text.Json.JsonSerializerOptions -> obj
<Extension()>
Public Function Deserialize (node As JsonNode, returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object

パラメーター

node
JsonNode

変換する JsonNode

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

JSON 値の returnType 表現。

属性

例外

returnType は JSON と互換性がありません。

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

適用対象

Deserialize(JsonElement, Type, JsonSerializerContext)

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

1 つの JSON 値を表す JsonElementreturnTypeに変換します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Deserialize(System::Text::Json::JsonElement element, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(this System.Text.Json.JsonElement element, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : System.Text.Json.JsonElement * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
<Extension()>
Public Function Deserialize (element As JsonElement, returnType As Type, context As JsonSerializerContext) As Object

パラメーター

element
JsonElement

変換する JsonElement

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

returnTypenullです。

-又は-

contextnullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

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

適用対象

Deserialize(JsonElement, Type, JsonSerializerOptions)

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

1 つの JSON 値を表す JsonElementreturnTypeに変換します。

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

パラメーター

element
JsonElement

変換する JsonElement

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

JSON 値の returnType 表現。

属性

例外

returnTypenullです。

returnType は JSON と互換性がありません。

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

適用対象

Deserialize(JsonDocument, Type, JsonSerializerContext)

ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs

1 つの JSON 値を表す JsonDocumentreturnTypeに変換します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Deserialize(System::Text::Json::JsonDocument ^ document, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(this System.Text.Json.JsonDocument document, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : System.Text.Json.JsonDocument * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
<Extension()>
Public Function Deserialize (document As JsonDocument, returnType As Type, context As JsonSerializerContext) As Object

パラメーター

document
JsonDocument

変換する JsonDocument

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

documentnullです。

-又は-

returnTypenullです。

-又は-

contextnullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

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

適用対象

Deserialize(JsonDocument, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs

1 つの JSON 値を表す JsonDocumentreturnTypeに変換します。

[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 object? Deserialize(this System.Text.Json.JsonDocument document, Type returnType, 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 object? Deserialize(this System.Text.Json.JsonDocument document, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object? Deserialize(this System.Text.Json.JsonDocument document, Type returnType, 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 Deserialize : System.Text.Json.JsonDocument * Type * System.Text.Json.JsonSerializerOptions -> obj
[<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 Deserialize : System.Text.Json.JsonDocument * Type * System.Text.Json.JsonSerializerOptions -> obj
static member Deserialize : System.Text.Json.JsonDocument * Type * System.Text.Json.JsonSerializerOptions -> obj
<Extension()>
Public Function Deserialize (document As JsonDocument, returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object

パラメーター

document
JsonDocument

変換する JsonDocument

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

JSON 値の returnType 表現。

属性

例外

document または returnTypenull

returnType は JSON と互換性がありません。

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

適用対象

Deserialize(String, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを、指定した型のインスタンスに解析します。

[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 object? Deserialize(string json, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object? Deserialize(string json, Type returnType, 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 object? Deserialize(string json, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object Deserialize(string json, Type returnType, 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 Deserialize : string * Type * System.Text.Json.JsonSerializerOptions -> obj
static member Deserialize : string * Type * System.Text.Json.JsonSerializerOptions -> obj
[<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 Deserialize : string * Type * System.Text.Json.JsonSerializerOptions -> obj
Public Function Deserialize (json As String, returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object
Public Shared Function Deserialize (json As String, returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object

パラメーター

json
String

解析する JSON テキスト。

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

JSON 値の returnType 表現。

属性

例外

json または returnTypenull

JSON が無効です。

-又は-

TValue は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

Deserialize(ReadOnlySpan<Char>, Type, JsonSerializerContext)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを returnTypeに解析します。

public:
 static System::Object ^ Deserialize(ReadOnlySpan<char> json, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(ReadOnlySpan<char> json, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : ReadOnlySpan<char> * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
Public Function Deserialize (json As ReadOnlySpan(Of Char), returnType As Type, context As JsonSerializerContext) As Object

パラメーター

json
ReadOnlySpan<Char>

解析する JSON テキスト。

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

json または returnTypenull

-又は-

contextnullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

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

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

適用対象

Deserialize(ReadOnlySpan<Char>, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを、指定した型のインスタンスに解析します。

[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 object? Deserialize(ReadOnlySpan<char> json, Type returnType, 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 object? Deserialize(ReadOnlySpan<char> json, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object? Deserialize(ReadOnlySpan<char> json, Type returnType, 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 Deserialize : ReadOnlySpan<char> * Type * System.Text.Json.JsonSerializerOptions -> obj
[<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 Deserialize : ReadOnlySpan<char> * Type * System.Text.Json.JsonSerializerOptions -> obj
static member Deserialize : ReadOnlySpan<char> * Type * System.Text.Json.JsonSerializerOptions -> obj
Public Function Deserialize (json As ReadOnlySpan(Of Char), returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object

パラメーター

json
ReadOnlySpan<Char>

解析する JSON テキスト。

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

JSON 値の returnType 表現。

属性

例外

returnTypenullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

スパンには、1 つの JSON 値を超える残りのデータがあります。

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

注釈

UTF-16 スパンの使用は、UTF-8 メソッドを使用する場合ほど効率的ではありません。実装では UTF-8 がネイティブに使用されるためです。

適用対象

Deserialize(String, Type, JsonSerializerContext)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを returnTypeに解析します。

public:
 static System::Object ^ Deserialize(System::String ^ json, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(string json, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : string * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
Public Function Deserialize (json As String, returnType As Type, context As JsonSerializerContext) As Object

パラメーター

json
String

解析する JSON テキスト。

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

json または returnTypenull

-又は-

contextnullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

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

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

適用対象

Deserialize(ReadOnlySpan<Byte>, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを、指定した型のインスタンスに解析します。

[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 object? Deserialize(ReadOnlySpan<byte> utf8Json, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object? Deserialize(ReadOnlySpan<byte> utf8Json, Type returnType, 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 object? Deserialize(ReadOnlySpan<byte> utf8Json, Type returnType, System.Text.Json.JsonSerializerOptions? options = default);
public static object Deserialize(ReadOnlySpan<byte> utf8Json, Type returnType, 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 Deserialize : ReadOnlySpan<byte> * Type * System.Text.Json.JsonSerializerOptions -> obj
static member Deserialize : ReadOnlySpan<byte> * Type * System.Text.Json.JsonSerializerOptions -> obj
[<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 Deserialize : ReadOnlySpan<byte> * Type * System.Text.Json.JsonSerializerOptions -> obj
Public Function Deserialize (utf8Json As ReadOnlySpan(Of Byte), returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object
Public Shared Function Deserialize (utf8Json As ReadOnlySpan(Of Byte), returnType As Type, Optional options As JsonSerializerOptions = Nothing) As Object

パラメーター

utf8Json
ReadOnlySpan<Byte>

解析する JSON テキスト。

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

JSON 値の returnType 表現。

属性

例外

returnTypenullです。

JSON が無効です。

-又は-

returnType は JSON と互換性がありません。

-又は-

スパンには、1 つの JSON 値を超える残りのデータがあります。

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

注釈

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

Deserialize(ReadOnlySpan<Byte>, JsonTypeInfo)

ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを、 jsonTypeInfoで指定されたインスタンスに解析します。

public:
 static System::Object ^ Deserialize(ReadOnlySpan<System::Byte> utf8Json, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(ReadOnlySpan<byte> utf8Json, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : ReadOnlySpan<byte> * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
Public Function Deserialize (utf8Json As ReadOnlySpan(Of Byte), jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

utf8Json
ReadOnlySpan<Byte>

解析する JSON テキスト。

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

JSON が無効であるか、バッファーに残りのデータがあります。

適用対象

Deserialize(ReadOnlySpan<Byte>, Type, JsonSerializerContext)

ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを returnTypeに解析します。

public:
 static System::Object ^ Deserialize(ReadOnlySpan<System::Byte> utf8Json, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(ReadOnlySpan<byte> utf8Json, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : ReadOnlySpan<byte> * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
Public Function Deserialize (utf8Json As ReadOnlySpan(Of Byte), returnType As Type, context As JsonSerializerContext) As Object

パラメーター

utf8Json
ReadOnlySpan<Byte>

解析する JSON テキスト。

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

returnTypenullです。

JSON が無効です。 returnType は JSON と互換性がありません。または、Stream に残りのデータがあります。

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

指定されたcontextGetTypeInfo(Type) メソッドは、returnTypeの互換性のあるJsonTypeInfoを返しませんでした。

適用対象

Deserialize(String, JsonTypeInfo)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを、 jsonTypeInfoで指定されたインスタンスに解析します。

public:
 static System::Object ^ Deserialize(System::String ^ json, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(string json, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : string * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
Public Function Deserialize (json As String, jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

json
String

解析する JSON テキスト。

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

jsonnullです。

-又は-

jsonTypeInfonullです。

JSON が無効です。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

適用対象

Deserialize(JsonDocument, JsonTypeInfo)

ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs

1 つの JSON 値を表す JsonDocument を、 jsonTypeInfoで指定されたインスタンスに変換します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Deserialize(System::Text::Json::JsonDocument ^ document, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(this System.Text.Json.JsonDocument document, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : System.Text.Json.JsonDocument * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
<Extension()>
Public Function Deserialize (document As JsonDocument, jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

document
JsonDocument

変換する JsonDocument

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

documentnullです。

-又は-

jsonTypeInfonullです。

適用対象

Deserialize(JsonElement, JsonTypeInfo)

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

1 つの JSON 値を表す JsonElement を、 jsonTypeInfoで指定されたインスタンスに変換します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Deserialize(System::Text::Json::JsonElement element, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(this System.Text.Json.JsonElement element, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : System.Text.Json.JsonElement * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
<Extension()>
Public Function Deserialize (element As JsonElement, jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

element
JsonElement

変換する JsonElement

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

jsonTypeInfonullです。

適用対象

Deserialize(ReadOnlySpan<Char>, JsonTypeInfo)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを、 jsonTypeInfoで指定されたインスタンスに解析します。

public:
 static System::Object ^ Deserialize(ReadOnlySpan<char> json, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(ReadOnlySpan<char> json, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : ReadOnlySpan<char> * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
Public Function Deserialize (json As ReadOnlySpan(Of Char), jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

json
ReadOnlySpan<Char>

解析する JSON テキスト。

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

jsonTypeInfonullです。

JSON が無効です。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

適用対象

Deserialize(Utf8JsonReader, JsonTypeInfo)

ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を、 jsonTypeInfoで指定されたインスタンスに読み取ります。

public:
 static System::Object ^ Deserialize(System::Text::Json::Utf8JsonReader % reader, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : Utf8JsonReader * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
Public Function Deserialize (ByRef reader As Utf8JsonReader, jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

reader
Utf8JsonReader

読み取るリーダー。

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

JSON が無効であるか、 jsonTypeInfo が JSON と互換性がない、または値をリーダーから読み取れませんでした。

reader はサポートされていないオプションを使用しています。

注釈

readerTokenType プロパティがPropertyNameまたはNoneの場合、リーダーは 1 回の呼び出しで値の開始を決定するためにRead()されます。

このメソッドが完了すると、 reader は JSON 値の最後のトークンに配置されます。 例外がスローされた場合、リーダーはメソッドが呼び出されたときの状態にリセットされます。

このメソッドは、リーダーが操作したデータのコピーを作成するため、このメソッドの戻り値を超えてデータの整合性を維持する呼び出し元の要件はありません。

Utf8JsonReaderのインスタンスの作成に使用されるJsonReaderOptionsは、競合時にJsonSerializerOptionsよりも優先されます。 したがって、 AllowTrailingCommasMaxDepth、および CommentHandling は読み取り中に使用されます。

適用対象

Deserialize(Stream, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを returnTypeに読み取ります。 Stream は読み取って完了します。

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

パラメーター

utf8Json
Stream

解析する JSON データ。

returnType
Type

変換して返すオブジェクトの型。

options
JsonSerializerOptions

読み取り中の動作を制御するオプション。

返品

JSON 値の returnType 表現。

属性

例外

utf8Json または returnTypenull

JSON が無効であるか、 returnType が JSON と互換性がない、またはストリームに残りのデータがある。

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

適用対象

Deserialize(Stream, Type, JsonSerializerContext)

ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを returnTypeに読み取ります。 Stream は読み取って完了します。

public:
 static System::Object ^ Deserialize(System::IO::Stream ^ utf8Json, Type ^ returnType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static object? Deserialize(System.IO.Stream utf8Json, Type returnType, System.Text.Json.Serialization.JsonSerializerContext context);
static member Deserialize : System.IO.Stream * Type * System.Text.Json.Serialization.JsonSerializerContext -> obj
Public Function Deserialize (utf8Json As Stream, returnType As Type, context As JsonSerializerContext) As Object

パラメーター

utf8Json
Stream

解析する JSON データ。

returnType
Type

変換して返すオブジェクトの型。

context
JsonSerializerContext

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

返品

JSON 値の returnType 表現。

例外

utf8JsonreturnType、または contextnull

JSON が無効であるか、 returnType が JSON と互換性がない、またはストリームに残りのデータがある。

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

指定されたcontextGetTypeInfo(Type) メソッドは、returnTypeの互換性のあるJsonTypeInfoを返しませんでした。

適用対象

Deserialize(JsonNode, JsonTypeInfo)

ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs

1 つの JSON 値を表す JsonNode を、 jsonTypeInfoで指定されたインスタンスに変換します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ Deserialize(System::Text::Json::Nodes::JsonNode ^ node, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static object? Deserialize(this System.Text.Json.Nodes.JsonNode? node, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member Deserialize : System.Text.Json.Nodes.JsonNode * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> obj
<Extension()>
Public Function Deserialize (node As JsonNode, jsonTypeInfo As JsonTypeInfo) As Object

パラメーター

node
JsonNode

変換する JsonNode

jsonTypeInfo
JsonTypeInfo

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

返品

JSON 値の jsonTypeInfo 表現。

例外

jsonTypeInfonullです。

適用対象

Deserialize<TValue>(JsonDocument, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs

1 つの JSON 値を表す JsonDocumentTValueに変換します。

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static TValue Deserialize(System::Text::Json::JsonDocument ^ document, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(this System.Text.Json.JsonDocument document, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : System.Text.Json.JsonDocument * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
<Extension()>
Public Function Deserialize(Of TValue) (document As JsonDocument, jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

document
JsonDocument

変換する JsonDocument

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

documentnullです。

-又は-

jsonTypeInfonullです。

TValue は JSON と互換性がありません。

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

適用対象

Deserialize<TValue>(Utf8JsonReader, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs

指定されたリーダーから 1 つの JSON 値 (オブジェクトまたは配列を含む) を TValueに読み取ります。

public:
generic <typename TValue>
 static TValue Deserialize(System::Text::Json::Utf8JsonReader % reader, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : Utf8JsonReader * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
Public Function Deserialize(Of TValue) (ByRef reader As Utf8JsonReader, jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

reader
Utf8JsonReader

読み取るリーダー。

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

JSON が無効であるか、 TValue が JSON と互換性がない、または値をリーダーから読み取れませんでした。

reader はサポートされていないオプションを使用しています。

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

注釈

readerTokenType プロパティがPropertyNameまたはNoneの場合、リーダーは 1 回の呼び出しで値の開始を決定するためにRead()されます。

このメソッドが完了すると、 reader は JSON 値の最後のトークンに配置されます。 例外がスローされた場合、リーダーはメソッドが呼び出されたときの状態にリセットされます。

このメソッドは、リーダーが操作したデータのコピーを作成するため、このメソッドの戻り値を超えてデータの整合性を維持する呼び出し元の要件はありません。

Utf8JsonReaderのインスタンスの作成に使用されるJsonReaderOptionsは、競合時にJsonSerializerOptionsよりも優先されます。 したがって、 AllowTrailingCommasMaxDepth、および CommentHandling は読み取り中に使用されます。

適用対象

Deserialize<TValue>(Utf8JsonReader, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs
ソース:
JsonSerializer.Read.Utf8JsonReader.cs

指定されたリーダーから、ジェネリック型パラメーターで指定された型のインスタンスに 1 つの JSON 値 (オブジェクトまたは配列を含む) を読み取ります。

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

型パラメーター

TValue

JSON 値のターゲット型。

パラメーター

reader
Utf8JsonReader

JSON を読み取るリーダー。

options
JsonSerializerOptions

読み取り中にシリアライザーの動作を制御するオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

JSON が無効です。

-又は-

TValue は JSON と互換性がありません。

-又は-

値をリーダーから読み取れませんでした。

reader では、サポートされていないオプションが使用されます。

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

注釈

readerTokenType プロパティがJsonTokenType.PropertyNameまたはJsonTokenType.Noneの場合、リーダーは 1 回の呼び出しで値の開始を決定するためにUtf8JsonReader.Read()されます。

このメソッドが完了すると、 reader は JSON 値の最後のトークンに配置されます。 例外がスローされた場合、リーダーはメソッドが呼び出されたときの状態にリセットされます。

このメソッドは、リーダーが操作したデータのコピーを作成するため、このメソッドの戻り値を超えてデータの整合性を維持する呼び出し元の要件はありません。

Utf8JsonReaderのインスタンスの作成に使用されるJsonReaderOptionsは、競合時にJsonSerializerOptionsよりも優先されます。 したがって、 JsonReaderOptions.AllowTrailingCommasJsonReaderOptions.MaxDepth、および JsonReaderOptions.CommentHandling は読み取り中に使用されます。

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

Deserialize<TValue>(JsonNode, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs

1 つの JSON 値を表す JsonNodeTValueに変換します。

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static TValue Deserialize(System::Text::Json::Nodes::JsonNode ^ node, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(this System.Text.Json.Nodes.JsonNode? node, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : System.Text.Json.Nodes.JsonNode * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
<Extension()>
Public Function Deserialize(Of TValue) (node As JsonNode, jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

node
JsonNode

変換する JsonNode

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

jsonTypeInfonullです。

TValue は JSON と互換性がありません。

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

適用対象

Deserialize<TValue>(JsonNode, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs
ソース:
JsonSerializer.Read.Node.cs

1 つの JSON 値を表す JsonNodeTValueに変換します。

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

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

node
JsonNode

変換する JsonNode

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

TValue は JSON と互換性がありません。

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

適用対象

Deserialize<TValue>(JsonElement, JsonTypeInfo<TValue>)

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

1 つの JSON 値を表す JsonElementTValueに変換します。

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static TValue Deserialize(System::Text::Json::JsonElement element, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(this System.Text.Json.JsonElement element, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : System.Text.Json.JsonElement * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
<Extension()>
Public Function Deserialize(Of TValue) (element As JsonElement, jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

element
JsonElement

変換する JsonElement

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

jsonTypeInfonullです。

TValue は JSON と互換性がありません。

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

適用対象

Deserialize<TValue>(JsonElement, JsonSerializerOptions)

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

1 つの JSON 値を表す JsonElementTValueに変換します。

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

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

element
JsonElement

変換する JsonElement

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

TValue は JSON と互換性がありません。

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

適用対象

Deserialize<TValue>(JsonDocument, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs
ソース:
JsonSerializer.Read.Document.cs

1 つの JSON 値を表す JsonDocumentTValueに変換します。

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

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

document
JsonDocument

変換する JsonDocument

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

documentnullです。

TValue は JSON と互換性がありません。

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

適用対象

Deserialize<TValue>(ReadOnlySpan<Byte>, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs

単一の JSON 値を表す UTF-8 でエンコードされたテキストを、ジェネリック型パラメーターで指定された型のインスタンスに解析します。

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

型パラメーター

TValue

UTF-8 でエンコードされたテキストのターゲット型。

パラメーター

utf8Json
ReadOnlySpan<Byte>

解析する JSON テキスト。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

JSON が無効です。

-又は-

TValue は JSON と互換性がありません。

-又は-

スパンには、1 つの JSON 値を超える残りのデータがあります。

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

注釈

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

Deserialize<TValue>(String, JsonSerializerOptions)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

単一の JSON 値を表すテキストを、ジェネリック型パラメーターで指定された型のインスタンスに解析します。

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

型パラメーター

TValue

JSON 値のターゲット型。

パラメーター

json
String

解析する JSON テキスト。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

jsonnullです。

JSON が無効です。

-又は-

TValue は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

Deserialize<TValue>(ReadOnlySpan<Char>, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを TValueに解析します。

public:
generic <typename TValue>
 static TValue Deserialize(ReadOnlySpan<char> json, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(ReadOnlySpan<char> json, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : ReadOnlySpan<char> * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
Public Function Deserialize(Of TValue) (json As ReadOnlySpan(Of Char), jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

json
ReadOnlySpan<Char>

解析する JSON テキスト。

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

jsonnullです。

-又は-

jsonTypeInfonullです。

JSON が無効です。

-又は-

TValue は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

適用対象

Deserialize<TValue>(ReadOnlySpan<Char>, JsonSerializerOptions)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

単一の JSON 値を表すテキストを、ジェネリック型パラメーターで指定された型のインスタンスに解析します。

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

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

json
ReadOnlySpan<Char>

解析する JSON テキスト。

options
JsonSerializerOptions

解析中の動作を制御するためのオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

JSON が無効です。

-又は-

TValue は JSON と互換性がありません。

-又は-

スパンには、1 つの JSON 値を超える残りのデータがあります。

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

注釈

UTF-16 スパンの使用は、UTF-8 メソッドを使用する場合ほど効率的ではありません。実装では UTF-8 がネイティブに使用されるためです。

適用対象

Deserialize<TValue>(ReadOnlySpan<Byte>, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs
ソース:
JsonSerializer.Read.Span.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを TValueに解析します。

public:
generic <typename TValue>
 static TValue Deserialize(ReadOnlySpan<System::Byte> utf8Json, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(ReadOnlySpan<byte> utf8Json, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : ReadOnlySpan<byte> * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
Public Function Deserialize(Of TValue) (utf8Json As ReadOnlySpan(Of Byte), jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

utf8Json
ReadOnlySpan<Byte>

解析する JSON テキスト。

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

JSON が無効です。 TValue は JSON と互換性がありません。または、Stream に残りのデータがあります。

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

適用対象

Deserialize<TValue>(Stream, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを TValueに読み取ります。 Stream は読み取って完了します。

public:
generic <typename TValue>
 static TValue Deserialize(System::IO::Stream ^ utf8Json, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(System.IO.Stream utf8Json, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : System.IO.Stream * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
Public Function Deserialize(Of TValue) (utf8Json As Stream, jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

utf8Json
Stream

解析する JSON データ。

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

utf8Json または jsonTypeInfonull

JSON が無効です。 TValue は JSON と互換性がありません。または、Stream に残りのデータがあります。

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

適用対象

Deserialize<TValue>(Stream, JsonSerializerOptions)

ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs
ソース:
JsonSerializer.Read.Stream.cs

1 つの JSON 値を表す UTF-8 でエンコードされたテキストを TValueに読み取ります。 Stream は読み取って完了します。

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

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

utf8Json
Stream

解析する JSON データ。

options
JsonSerializerOptions

読み取り中の動作を制御するオプション。

返品

TValue

JSON 値の TValue 表現。

属性

例外

utf8Jsonnullです。

JSON が無効です。 TValue は JSON と互換性がありません。または、Stream に残りのデータがあります。

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

適用対象

Deserialize<TValue>(String, JsonTypeInfo<TValue>)

ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs
ソース:
JsonSerializer.Read.String.cs

1 つの JSON 値を表すテキストを TValueに解析します。

public:
generic <typename TValue>
 static TValue Deserialize(System::String ^ json, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static TValue? Deserialize<TValue>(string json, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member Deserialize : string * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> 'Value
Public Function Deserialize(Of TValue) (json As String, jsonTypeInfo As JsonTypeInfo(Of TValue)) As TValue

型パラメーター

TValue

JSON 値を逆シリアル化する型。

パラメーター

json
String

解析する JSON テキスト。

jsonTypeInfo
JsonTypeInfo<TValue>

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

返品

TValue

JSON 値の TValue 表現。

例外

jsonnullです。

-又は-

jsonTypeInfonullです。

JSON が無効です。

-又は-

TValue は JSON と互換性がありません。

-又は-

文字列には、1 つの JSON 値を超える残りのデータがあります。

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

注釈

実装では UTF-8 がネイティブに使用されるため、 String の使用は UTF-8 メソッドを使用するほど効率的ではありません。

適用対象