AsyncEnumerable.DefaultIfEmpty Método

Definição

Sobrecargas

Name Description
DefaultIfEmpty<TSource>(IAsyncEnumerable<TSource>)

Devolve os elementos da sequência especificada ou o padrão do parâmetro de tipo se a sequência estiver vazia.

DefaultIfEmpty<TSource>(IAsyncEnumerable<TSource>, TSource)

Devolve os elementos da sequência especificada ou o valor especificado se a sequência estiver vazia.

DefaultIfEmpty<TSource>(IAsyncEnumerable<TSource>)

Origem:
DefaultIfEmpty.cs
Origem:
DefaultIfEmpty.cs
Origem:
DefaultIfEmpty.cs

Devolve os elementos da sequência especificada ou o padrão do parâmetro de tipo se a sequência estiver vazia.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ DefaultIfEmpty(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source);
public static System.Collections.Generic.IAsyncEnumerable<TSource?> DefaultIfEmpty<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source);
static member DefaultIfEmpty : System.Collections.Generic.IAsyncEnumerable<'Source> -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function DefaultIfEmpty(Of TSource) (source As IAsyncEnumerable(Of TSource)) As IAsyncEnumerable(Of TSource)

Parâmetros de Tipo Genérico

TSource

O tipo dos elementos da fonte.

Parâmetros

source
IAsyncEnumerable<TSource>

A sequência para devolver um valor padrão para se estiver vazia.

Devoluções

IAsyncEnumerable<TSource>

Um objeto que contém o valor padrão para o tipo TSource se a IAsyncEnumerable<T> fonte estiver vazia; caso contrário, a fonte.

Exceções

source é null.

Aplica-se a

DefaultIfEmpty<TSource>(IAsyncEnumerable<TSource>, TSource)

Origem:
DefaultIfEmpty.cs
Origem:
DefaultIfEmpty.cs
Origem:
DefaultIfEmpty.cs

Devolve os elementos da sequência especificada ou o valor especificado se a sequência estiver vazia.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<TSource> ^ DefaultIfEmpty(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, TSource defaultValue);
public static System.Collections.Generic.IAsyncEnumerable<TSource> DefaultIfEmpty<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, TSource defaultValue);
static member DefaultIfEmpty : System.Collections.Generic.IAsyncEnumerable<'Source> * 'Source -> System.Collections.Generic.IAsyncEnumerable<'Source>
<Extension()>
Public Function DefaultIfEmpty(Of TSource) (source As IAsyncEnumerable(Of TSource), defaultValue As TSource) As IAsyncEnumerable(Of TSource)

Parâmetros de Tipo Genérico

TSource

O tipo dos elementos da fonte.

Parâmetros

source
IAsyncEnumerable<TSource>

A sequência para devolver um valor padrão para se estiver vazia.

defaultValue
TSource

O valor a devolver se a sequência estiver vazia.

Devoluções

IAsyncEnumerable<TSource>

Um objeto que contém o valor padrão para o tipo TSource se a IAsyncEnumerable<T> fonte estiver vazia; caso contrário, a fonte.

Exceções

source é null.

Aplica-se a