語言

AsyncEnumerable.Distinct<TSource> 方法

定義

回傳序列中不同的元素。

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

類型參數

TSource

參數

source
IAsyncEnumerable<TSource>

移除重複元素的序列。

comparer
IEqualityComparer<TSource>

然後 IEqualityComparer<T> 比較價值。

傳回

IAsyncEnumerable<TSource>

包含 IAsyncEnumerable<T> 源序列中不同元素的 。

例外狀況

source 是 null。

適用於