SuperLinq SuperLinq
SuperLinq SuperLinq
DocFX + Singulink = ♥

Search Results for

    Method DuplicatesBy

    DuplicatesBy<TSource, TKey>(IAsyncEnumerable<TSource>, Func<TSource, TKey>)

    Returns the sequence of elements whose keys occur in the source sequence more than once.

    Declaration
    public static IAsyncEnumerable<TSource> DuplicatesBy<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> source

    The source sequence.

    Func<TSource, TKey> keySelector

    A function to extract the key for each element.

    Returns
    Type Description
    IAsyncEnumerable<TSource>

    One element for each key that occurs more than once.

    Type Parameters
    Name Description
    TSource

    The type of the elements in the source sequence.

    TKey

    The type of the key used to identify duplicates.

    Remarks

    This operator uses deferred execution and streams its results.

    Exceptions
    Type Condition
    ArgumentNullException

    source or keySelector is null.

    DuplicatesBy<TSource, TKey>(IAsyncEnumerable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>?)

    Returns the sequence of elements whose keys occur in the source sequence more than once.

    Declaration
    public static IAsyncEnumerable<TSource> DuplicatesBy<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> source

    The source sequence.

    Func<TSource, TKey> keySelector

    A function to extract the key for each element.

    IEqualityComparer<TKey> comparer

    The equality comparer used to compare keys, or null to use the default.

    Returns
    Type Description
    IAsyncEnumerable<TSource>

    One element for each key that occurs more than once.

    Type Parameters
    Name Description
    TSource

    The type of the elements in the source sequence.

    TKey

    The type of the key used to identify duplicates.

    Remarks

    This operator uses deferred execution and streams its results.

    Exceptions
    Type Condition
    ArgumentNullException

    source or keySelector is null.

    © SuperLinq Authors. All rights reserved.