SuperLinq SuperLinq
SuperLinq SuperLinq
DocFX + Singulink = ♥

Search Results for

    Method ExceptBy

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

    Returns the set of elements in the first sequence which aren't in the second sequence, according to a given key selector.

    Declaration
    public static IAsyncEnumerable<TSource> ExceptBy<TSource, TKey>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, Func<TSource, TKey> keySelector)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> first

    The sequence of potentially included elements.

    IAsyncEnumerable<TSource> second

    The sequence of elements whose keys may prevent elements in first from being returned.

    Func<TSource, TKey> keySelector

    The mapping from source element to key.

    Returns
    Type Description
    IAsyncEnumerable<TSource>

    A sequence of elements from first whose key was not also a key for any element in second.

    Type Parameters
    Name Description
    TSource

    The type of the elements in the input sequences.

    TKey

    The type of the key returned by keySelector.

    Remarks

    This is a set operation; if multiple elements in first have equal keys, only the first such element is returned. This operator uses deferred execution and streams the results, although a set of keys from second is immediately selected and retained.

    Exceptions
    Type Condition
    ArgumentNullException

    first is null.

    ArgumentNullException

    second is null.

    ArgumentNullException

    keySelector is null.

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

    Returns the set of elements in the first sequence which aren't in the second sequence, according to a given key selector.

    Declaration
    public static IAsyncEnumerable<TSource> ExceptBy<TSource, TKey>(this IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> first

    The sequence of potentially included elements.

    IAsyncEnumerable<TSource> second

    The sequence of elements whose keys may prevent elements in first from being returned.

    Func<TSource, TKey> keySelector

    The mapping from source element to key.

    IEqualityComparer<TKey> keyComparer

    The equality comparer to use to determine whether or not keys are equal. If null, the default equality comparer for TSource is used.

    Returns
    Type Description
    IAsyncEnumerable<TSource>

    A sequence of elements from first whose key was not also a key for any element in second.

    Type Parameters
    Name Description
    TSource

    The type of the elements in the input sequences.

    TKey

    The type of the key returned by keySelector.

    Remarks

    This is a set operation; if multiple elements in first have equal keys, only the first such element is returned. This operator uses deferred execution and streams the results, although a set of keys from second is immediately selected and retained.

    Exceptions
    Type Condition
    ArgumentNullException

    first is null.

    ArgumentNullException

    second is null.

    ArgumentNullException

    keySelector is null.

    ArgumentNullException

    keyComparer is null.

    © SuperLinq Authors. All rights reserved.