JsonSerializer.SerializeAsyncEnumerable 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
SerializeAsyncEnumerable<TValue>(PipeWriter, IAsyncEnumerable<TValue>, Boolean, JsonSerializerOptions, CancellationToken)
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task SerializeAsyncEnumerable<TValue>(System.IO.Pipelines.PipeWriter utf8Json, System.Collections.Generic.IAsyncEnumerable<TValue> value, bool topLevelValues = false, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task SerializeAsyncEnumerable<TValue>(System.IO.Pipelines.PipeWriter utf8Json, System.Collections.Generic.IAsyncEnumerable<TValue> value, bool topLevelValues = false, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = 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 SerializeAsyncEnumerable : System.IO.Pipelines.PipeWriter * System.Collections.Generic.IAsyncEnumerable<'Value> * bool * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
static member SerializeAsyncEnumerable : System.IO.Pipelines.PipeWriter * System.Collections.Generic.IAsyncEnumerable<'Value> * bool * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SerializeAsyncEnumerable(Of TValue) (utf8Json As PipeWriter, value As IAsyncEnumerable(Of TValue), Optional topLevelValues As Boolean = false, Optional options As JsonSerializerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
類型參數
- TValue
參數
- utf8Json
- PipeWriter
- value
- IAsyncEnumerable<TValue>
- topLevelValues
- Boolean
- options
- JsonSerializerOptions
- cancellationToken
- CancellationToken
傳回
- 屬性
適用於
SerializeAsyncEnumerable<TValue>(PipeWriter, IAsyncEnumerable<TValue>, JsonTypeInfo<TValue>, Boolean, CancellationToken)
public static System.Threading.Tasks.Task SerializeAsyncEnumerable<TValue>(System.IO.Pipelines.PipeWriter utf8Json, System.Collections.Generic.IAsyncEnumerable<TValue> value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, bool topLevelValues = false, System.Threading.CancellationToken cancellationToken = default);
static member SerializeAsyncEnumerable : System.IO.Pipelines.PipeWriter * System.Collections.Generic.IAsyncEnumerable<'Value> * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SerializeAsyncEnumerable(Of TValue) (utf8Json As PipeWriter, value As IAsyncEnumerable(Of TValue), jsonTypeInfo As JsonTypeInfo(Of TValue), Optional topLevelValues As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task
類型參數
- TValue
參數
- utf8Json
- PipeWriter
- value
- IAsyncEnumerable<TValue>
- jsonTypeInfo
- JsonTypeInfo<TValue>
- topLevelValues
- Boolean
- cancellationToken
- CancellationToken
傳回
適用於
SerializeAsyncEnumerable<TValue>(Stream, IAsyncEnumerable<TValue>, Boolean, JsonSerializerOptions, CancellationToken)
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task SerializeAsyncEnumerable<TValue>(System.IO.Stream utf8Json, System.Collections.Generic.IAsyncEnumerable<TValue> value, bool topLevelValues = false, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task SerializeAsyncEnumerable<TValue>(System.IO.Stream utf8Json, System.Collections.Generic.IAsyncEnumerable<TValue> value, bool topLevelValues = false, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = 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 SerializeAsyncEnumerable : System.IO.Stream * System.Collections.Generic.IAsyncEnumerable<'Value> * bool * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
static member SerializeAsyncEnumerable : System.IO.Stream * System.Collections.Generic.IAsyncEnumerable<'Value> * bool * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SerializeAsyncEnumerable(Of TValue) (utf8Json As Stream, value As IAsyncEnumerable(Of TValue), Optional topLevelValues As Boolean = false, Optional options As JsonSerializerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
類型參數
- TValue
參數
- utf8Json
- Stream
- value
- IAsyncEnumerable<TValue>
- topLevelValues
- Boolean
- options
- JsonSerializerOptions
- cancellationToken
- CancellationToken
傳回
- 屬性
適用於
SerializeAsyncEnumerable<TValue>(Stream, IAsyncEnumerable<TValue>, JsonTypeInfo<TValue>, Boolean, CancellationToken)
public static System.Threading.Tasks.Task SerializeAsyncEnumerable<TValue>(System.IO.Stream utf8Json, System.Collections.Generic.IAsyncEnumerable<TValue> value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, bool topLevelValues = false, System.Threading.CancellationToken cancellationToken = default);
static member SerializeAsyncEnumerable : System.IO.Stream * System.Collections.Generic.IAsyncEnumerable<'Value> * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SerializeAsyncEnumerable(Of TValue) (utf8Json As Stream, value As IAsyncEnumerable(Of TValue), jsonTypeInfo As JsonTypeInfo(Of TValue), Optional topLevelValues As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task
類型參數
- TValue
參數
- utf8Json
- Stream
- value
- IAsyncEnumerable<TValue>
- jsonTypeInfo
- JsonTypeInfo<TValue>
- topLevelValues
- Boolean
- cancellationToken
- CancellationToken