SuperLinq SuperLinq
SuperLinq SuperLinq
DocFX + Singulink = ♥

Search Results for

    Method FallbackIfEmpty

    FallbackIfEmpty<T>(IAsyncEnumerable<T>, params T[])

    Returns the elements of a sequence, but if it is empty then returns an alternate sequence from an array of values.

    Declaration
    public static IAsyncEnumerable<T> FallbackIfEmpty<T>(this IAsyncEnumerable<T> source, params T[] fallback)
    Parameters
    Type Name Description
    IAsyncEnumerable<T> source

    The source sequence.

    T[] fallback

    The array that is returned as the alternate sequence if source is empty.

    Returns
    Type Description
    IAsyncEnumerable<T>

    An IAsyncEnumerable<T> that containing fallback values if source is empty; otherwise, source.

    Type Parameters
    Name Description
    T

    The type of the elements in the sequences.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null.

    ArgumentNullException

    fallback is null.

    FallbackIfEmpty<T>(IAsyncEnumerable<T>, IEnumerable<T>)

    Returns the elements of a sequence, but if it is empty then returns an alternate sequence from an array of values.

    Declaration
    public static IAsyncEnumerable<T> FallbackIfEmpty<T>(this IAsyncEnumerable<T> source, IEnumerable<T> fallback)
    Parameters
    Type Name Description
    IAsyncEnumerable<T> source

    The source sequence.

    IEnumerable<T> fallback

    The array that is returned as the alternate sequence if source is empty.

    Returns
    Type Description
    IAsyncEnumerable<T>

    An IAsyncEnumerable<T> that containing fallback values if source is empty; otherwise, source.

    Type Parameters
    Name Description
    T

    The type of the elements in the sequences.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null.

    ArgumentNullException

    fallback is null.

    FallbackIfEmpty<T>(IAsyncEnumerable<T>, IAsyncEnumerable<T>)

    Returns the elements of a sequence, but if it is empty then returns an alternate sequence of values.

    Declaration
    public static IAsyncEnumerable<T> FallbackIfEmpty<T>(this IAsyncEnumerable<T> source, IAsyncEnumerable<T> fallback)
    Parameters
    Type Name Description
    IAsyncEnumerable<T> source

    The source sequence.

    IAsyncEnumerable<T> fallback

    The alternate sequence that is returned if source is empty.

    Returns
    Type Description
    IAsyncEnumerable<T>

    An IAsyncEnumerable<T> that containing fallback values if source is empty; otherwise, source.

    Type Parameters
    Name Description
    T

    The type of the elements in the sequences.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null.

    ArgumentNullException

    fallback is null.

    © SuperLinq Authors. All rights reserved.