ParallelEnumerable.DefaultIfEmpty メソッド
定義
指定された並列シーケンスの要素、または、シーケンスが空の場合はシングルトン コレクションにある指定された値を返します。Returns the elements of the specified parallel sequence or the specified value in a singleton collection if the sequence is empty.
オーバーロード
DefaultIfEmpty<TSource>(ParallelQuery<TSource>) |
指定した並列シーケンスの要素、または、シーケンスが空の場合はシングルトン コレクションにある型パラメーターの既定値を返します。Returns the elements of the specified parallel sequence or the type parameter's default value in a singleton collection if the sequence is empty. |
DefaultIfEmpty<TSource>(ParallelQuery<TSource>, TSource) |
指定された並列シーケンスの要素、または、シーケンスが空の場合はシングルトン コレクションにある指定された値を返します。Returns the elements of the specified parallel sequence or the specified value in a singleton collection if the sequence is empty. |
DefaultIfEmpty<TSource>(ParallelQuery<TSource>)
指定した並列シーケンスの要素、または、シーケンスが空の場合はシングルトン コレクションにある型パラメーターの既定値を返します。Returns the elements of the specified parallel sequence or the type parameter's default value in a singleton collection if the sequence is empty.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Linq::ParallelQuery<TSource> ^ DefaultIfEmpty(System::Linq::ParallelQuery<TSource> ^ source);
public static System.Linq.ParallelQuery<TSource> DefaultIfEmpty<TSource> (this System.Linq.ParallelQuery<TSource> source);
static member DefaultIfEmpty : System.Linq.ParallelQuery<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function DefaultIfEmpty(Of TSource) (source As ParallelQuery(Of TSource)) As ParallelQuery(Of TSource)
型パラメーター
- TSource
source
の要素の型。The type of the elements of source
.
パラメーター
- source
- ParallelQuery<TSource>
シーケンスが空の場合に、既定値を返すシーケンス。The sequence to return a default value for if it is empty.
戻り値
source
が空の場合は default(TSource) が格納されているシーケンス。それ以外の場合は source
。A sequence that contains default(TSource) if source
is empty; otherwise, source
.
例外
source
が null 参照 (Visual Basic では Nothing) です。source
is a null reference (Nothing in Visual Basic).
WithCancellation
経由で渡されたトークンで、クエリが取り消されました。The query was canceled with the token passed in through WithCancellation
.
クエリ評価中に 1 つまたは複数の例外が発生しました。One or more exceptions occurred during the evaluation of the query.
こちらもご覧ください
DefaultIfEmpty<TSource>(ParallelQuery<TSource>, TSource)
指定された並列シーケンスの要素、または、シーケンスが空の場合はシングルトン コレクションにある指定された値を返します。Returns the elements of the specified parallel sequence or the specified value in a singleton collection if the sequence is empty.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Linq::ParallelQuery<TSource> ^ DefaultIfEmpty(System::Linq::ParallelQuery<TSource> ^ source, TSource defaultValue);
public static System.Linq.ParallelQuery<TSource> DefaultIfEmpty<TSource> (this System.Linq.ParallelQuery<TSource> source, TSource defaultValue);
static member DefaultIfEmpty : System.Linq.ParallelQuery<'Source> * 'Source -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function DefaultIfEmpty(Of TSource) (source As ParallelQuery(Of TSource), defaultValue As TSource) As ParallelQuery(Of TSource)
型パラメーター
- TSource
source
の要素の型。The type of the elements of source
.
パラメーター
- source
- ParallelQuery<TSource>
シーケンスが空の場合に、指定された値を返すシーケンス。The sequence to return the specified value for if it is empty.
- defaultValue
- TSource
シーケンスが空の場合に返す値。The value to return if the sequence is empty.
戻り値
source
が空の場合は defaultValue が格納されているシーケンス。それ以外の場合は source
。A sequence that contains defaultValue if source
is empty; otherwise, source
.
例外
source
が null 参照 (Visual Basic では Nothing) です。source
is a null reference (Nothing in Visual Basic).
WithCancellation
経由で渡されたトークンで、クエリが取り消されました。The query was canceled with the token passed in through WithCancellation
.
クエリ評価中に 1 つまたは複数の例外が発生しました。One or more exceptions occurred during the evaluation of the query.