HttpContentJsonExtensions.ReadFromJsonAsAsyncEnumerable Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
| Nom | Description |
|---|---|
| ReadFromJsonAsAsyncEnumerable<TValue>(HttpContent, CancellationToken) |
Lit le contenu HTTP et retourne la valeur qui résulte de la désérialisation du contenu en tant que JSON dans une opération énumérable asynchrone. |
| ReadFromJsonAsAsyncEnumerable<TValue>(HttpContent, JsonSerializerOptions, CancellationToken) |
Lit le contenu HTTP et retourne la valeur qui résulte de la désérialisation du contenu en tant que JSON dans une opération énumérable asynchrone. |
| ReadFromJsonAsAsyncEnumerable<TValue>(HttpContent, JsonTypeInfo<TValue>, CancellationToken) |
Lit le contenu HTTP et retourne la valeur qui résulte de la désérialisation du contenu en tant que JSON dans une opération énumérable asynchrone. |
ReadFromJsonAsAsyncEnumerable<TValue>(HttpContent, CancellationToken)
Lit le contenu HTTP et retourne la valeur qui résulte de la désérialisation du contenu en tant que JSON dans une opération énumérable asynchrone.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[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.Collections.Generic.IAsyncEnumerable<TValue?> ReadFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken = default);
public static System.Collections.Generic.IAsyncEnumerable<TValue?> ReadFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<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 ReadFromJsonAsAsyncEnumerable : System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
static member ReadFromJsonAsAsyncEnumerable : System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function ReadFromJsonAsAsyncEnumerable(Of TValue) (content As HttpContent, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Paramètres de type
- TValue
Type cible vers lequel désérialiser.
Paramètres
- content
- HttpContent
- cancellationToken
- CancellationToken
Retours
Qui IAsyncEnumerable<T> représente le corps de la réponse désérialisée.
- Attributs
Exceptions
content a la valeur null.
Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.
S’applique à
ReadFromJsonAsAsyncEnumerable<TValue>(HttpContent, JsonSerializerOptions, CancellationToken)
Lit le contenu HTTP et retourne la valeur qui résulte de la désérialisation du contenu en tant que JSON dans une opération énumérable asynchrone.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[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.Collections.Generic.IAsyncEnumerable<TValue?> ReadFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpContent content, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Collections.Generic.IAsyncEnumerable<TValue?> ReadFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpContent content, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<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 ReadFromJsonAsAsyncEnumerable : System.Net.Http.HttpContent * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
static member ReadFromJsonAsAsyncEnumerable : System.Net.Http.HttpContent * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function ReadFromJsonAsAsyncEnumerable(Of TValue) (content As HttpContent, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Paramètres de type
- TValue
Type cible vers lequel désérialiser.
Paramètres
- content
- HttpContent
Contenu à lire.
- options
- JsonSerializerOptions
Options permettant de contrôler le comportement pendant la désérialisation. Les options par défaut sont celles spécifiées par Web.
- cancellationToken
- CancellationToken
Retours
Qui IAsyncEnumerable<T> représente le corps de la réponse désérialisée.
- Attributs
Exceptions
content a la valeur null.
Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.
S’applique à
ReadFromJsonAsAsyncEnumerable<TValue>(HttpContent, JsonTypeInfo<TValue>, CancellationToken)
Lit le contenu HTTP et retourne la valeur qui résulte de la désérialisation du contenu en tant que JSON dans une opération énumérable asynchrone.
public static System.Collections.Generic.IAsyncEnumerable<TValue?> ReadFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpContent content, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member ReadFromJsonAsAsyncEnumerable : System.Net.Http.HttpContent * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function ReadFromJsonAsAsyncEnumerable(Of TValue) (content As HttpContent, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Paramètres de type
- TValue
Type cible vers lequel désérialiser.
Paramètres
- content
- HttpContent
Contenu à lire.
- jsonTypeInfo
- JsonTypeInfo<TValue>
JsonTypeInfo utilisé pour contrôler le comportement de désérialisation.
- cancellationToken
- CancellationToken
Retours
Qui IAsyncEnumerable<T> représente le corps de la réponse désérialisée.
Exceptions
content a la valeur null.
Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.