語言

AsyncEnumerable.Intersect<TSource> 方法

定義

產生兩個序列的集合交集。

public static System.Collections.Generic.IAsyncEnumerable<TSource> Intersect<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> first, System.Collections.Generic.IAsyncEnumerable<TSource> second, System.Collections.Generic.IEqualityComparer<TSource>? comparer = default);
static member Intersect : System.Collections.Generic.IAsyncEnumerable<'Source> * System.Collections.Generic.IAsyncEnumerable<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function Intersect(Of TSource) (first As IAsyncEnumerable(Of TSource), second As IAsyncEnumerable(Of TSource), Optional comparer As IEqualityComparer(Of TSource) = Nothing) As IAsyncEnumerable(Of TSource)

類型參數

TSource

輸入序列元素的類型。

參數

first
IAsyncEnumerable<TSource>

一個 IAsyncEnumerable<T> 同時出現在第二位的明顯元素。

second
IAsyncEnumerable<TSource>

IAsyncEnumerable<T>一個同時出現在第一個序列中的不同元素會被回傳。

comparer
IEqualityComparer<TSource>

然後 IEqualityComparer<T> 比較價值。

傳回

IAsyncEnumerable<TSource>

包含構成兩個序列交集集合元素的序列。

例外狀況

second 是 null。

適用於