AsyncEnumerable.Distinct<TSource> Method

Definition

Returns distinct elements from a sequence.

C#
public static System.Collections.Generic.IAsyncEnumerable<TSource> Distinct<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? comparer = default);

Type Parameters

TSource

Parameters

source
IAsyncEnumerable<TSource>

The sequence to remove duplicate elements from.

comparer
IEqualityComparer<TSource>

An IEqualityComparer<T> to compare values.

Returns

IAsyncEnumerable<TSource>

An IAsyncEnumerable<T> that contains distinct elements from the source sequence.

Exceptions

source is null.

Applies to

Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided), 10
.NET Standard 2.0 (package-provided)