語言

EntityFrameworkQueryableExtensions.AsAsyncEnumerable<TSource> 方法

定義

回傳 和 IAsyncEnumerable<T> ,可非同步列舉。

public static System.Collections.Generic.IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(this System.Linq.IQueryable<TSource> source);
static member AsAsyncEnumerable : System.Linq.IQueryable<'Source> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function AsAsyncEnumerable(Of TSource) (source As IQueryable(Of TSource)) As IAsyncEnumerable(Of TSource)

類型參數

TSource

元素 source的類型。

參數

source
IQueryable<TSource>

An IQueryable<T> 要列舉。

傳回

IAsyncEnumerable<TSource>

查詢結果。

例外狀況

source 是 null。

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中,請用 await 以確認所有非同步操作已完成,然後再呼叫其他方法。 更多資訊與範例請參見 「避免 DbContext 執行緒問題 」。

更多資訊與範例請參閱使用 EF Core 查詢資料 。

適用於