DbExpressionBuilder.SelectMany メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
| 名前 | 説明 |
|---|---|
| SelectMany(DbExpression, Func<DbExpression,DbExpression>) |
指定した入力セットの各要素に対して指定されたDbApplyExpression式を 1 回評価する新しい |
| SelectMany<TSelector>(DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression,TSelector>) |
指定した入力セットの各要素に対して指定されたDbApplyExpression式を 1 回評価する新しい |
SelectMany(DbExpression, Func<DbExpression,DbExpression>)
指定した入力セットの各要素に対して指定されたDbApplyExpression式を 1 回評価する新しいapplyを作成し、対応する入力を持つ行のコレクションを生成し、列を適用します。
applyが空のセットに評価される行は含まれません。 その後、各行からDbProjectExpression列を選択するapplyが作成され、結果のコレクション全体apply生成されます。
public:
[System::Runtime::CompilerServices::Extension]
static System::Data::Common::CommandTrees::DbProjectExpression ^ SelectMany(System::Data::Common::CommandTrees::DbExpression ^ source, Func<System::Data::Common::CommandTrees::DbExpression ^, System::Data::Common::CommandTrees::DbExpression ^> ^ apply);
public static System.Data.Common.CommandTrees.DbProjectExpression SelectMany(this System.Data.Common.CommandTrees.DbExpression source, Func<System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression> apply);
static member SelectMany : System.Data.Common.CommandTrees.DbExpression * Func<System.Data.Common.CommandTrees.DbExpression, System.Data.Common.CommandTrees.DbExpression> -> System.Data.Common.CommandTrees.DbProjectExpression
<Extension()>
Public Function SelectMany (source As DbExpression, apply As Func(Of DbExpression, DbExpression)) As DbProjectExpression
パラメーター
- source
- DbExpression
入力セットを指定する DbExpression 。
- apply
- Func<DbExpression,DbExpression>
入力セットのメンバーごとに 1 回評価するロジックを表すメソッド。
返品
指定した入力を持つ新しい DbApplyExpression から apply 列を選択し、バインディングと CrossApply の DbExpressionKind を適用する新しい DbProjectExpression。
例外
適用対象
SelectMany<TSelector>(DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression,TSelector>)
指定した入力セットの各要素に対して指定されたDbApplyExpression式を 1 回評価する新しいapplyを作成し、対応する入力を持つ行のコレクションを生成し、列を適用します。
applyが空のセットに評価される行は含まれません。 その後、各行に対して指定したDbProjectExpressionを選択するselectorが作成され、結果のコレクション全体が生成されます。
public:
generic <typename TSelector>
[System::Runtime::CompilerServices::Extension]
static System::Data::Common::CommandTrees::DbProjectExpression ^ SelectMany(System::Data::Common::CommandTrees::DbExpression ^ source, Func<System::Data::Common::CommandTrees::DbExpression ^, System::Data::Common::CommandTrees::DbExpression ^> ^ apply, Func<System::Data::Common::CommandTrees::DbExpression ^, System::Data::Common::CommandTrees::DbExpression ^, TSelector> ^ selector);
public static System.Data.Common.CommandTrees.DbProjectExpression SelectMany<TSelector>(this System.Data.Common.CommandTrees.DbExpression source, Func<System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression> apply, Func<System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,TSelector> selector);
static member SelectMany : System.Data.Common.CommandTrees.DbExpression * Func<System.Data.Common.CommandTrees.DbExpression, System.Data.Common.CommandTrees.DbExpression> * Func<System.Data.Common.CommandTrees.DbExpression, System.Data.Common.CommandTrees.DbExpression, 'Selector> -> System.Data.Common.CommandTrees.DbProjectExpression
<Extension()>
Public Function SelectMany(Of TSelector) (source As DbExpression, apply As Func(Of DbExpression, DbExpression), selector As Func(Of DbExpression, DbExpression, TSelector)) As DbProjectExpression
型パラメーター
- TSelector
selectorのメソッドの結果の型。
パラメーター
- source
- DbExpression
入力セットを指定する DbExpression 。
- apply
- Func<DbExpression,DbExpression>
入力セットのメンバーごとに 1 回評価するロジックを表すメソッド。
- selector
- Func<DbExpression,DbExpression,TSelector>
入力セットと適用セットの要素を指定して、結果セットの要素を派生させる方法を指定するメソッド。 このメソッドは、SelectMany と互換性があり、 DbExpressionに解決できる型のインスタンスを生成する必要があります。
TSelectorの互換性要件については、「解説」を参照してください。
返品
指定した入力を持つ新しい DbApplyExpression から指定されたセレクターの結果を選択し、バインディングと CrossApply の DbExpressionKind を適用する新しい DbProjectExpression。
例外
source、 apply 、または selector が null です。
-または-
applyによって生成される式が null です。
-または-
selectorの結果は、DbExpression への変換時に null になります。
注釈
SelectMany と互換性を持つには、 TSelector を DbExpressionから派生させるか、DbExpression から派生したプロパティを持つ匿名型である必要があります。
TSelectorでサポートされている型の例を次に示します。
source.SelectMany(x => x.Property("RelatedCollection"), (source, apply) => apply.Property("Name"))
(TSelector は DbPropertyExpression)。
source.SelectMany(x => x.Property("RelatedCollection"), (source, apply) => new { SourceName = source.Property("Name"), RelatedName = apply.Property("Name") })
(TSelector は、DbExpression 派生プロパティを持つ匿名型です)。