SelectMany(TInput, TBind, TResult) 方法 (CepStream(TInput), Expression(Func(CepStream(TInput), CepStream(TBind))), Expression(Func(TInput, TBind, TResult)))
根據兩個輸入資料流的交叉聯結,產生資料流。
命名空間: Microsoft.ComplexEventProcessing.Linq
組件: Microsoft.ComplexEventProcessing (在 Microsoft.ComplexEventProcessing.dll 中)
語法
public static CepStream<TResult> SelectMany<TInput, TBind, TResult>(
this CepStream<TInput> source,
Expression<Func<CepStream<TInput>, CepStream<TBind>>> bind,
Expression<Func<TInput, TBind, TResult>> selector
)
型別參數
- TInput
外部輸入資料流中之事件的裝載類型。
- TBind
內部輸入資料流中之事件的裝載類型。
- TResult
結果事件的裝載類型。
參數
- source
型別:Microsoft.ComplexEventProcessing.Linq. . :: . .CepStream< (Of < ( <'TInput> ) > ) >
外部輸入資料流。
- bind
型別:System.Linq.Expressions. . :: . .Expression< (Of < ( <'Func< (Of < ( <'CepStream< (Of < ( <'TInput> ) > ) >, CepStream< (Of < ( <'TBind> ) > ) >> ) > ) >> ) > ) >
內部輸入資料流。
- selector
型別:System.Linq.Expressions. . :: . .Expression< (Of < ( <'Func< (Of < ( <'TInput, TBind, TResult> ) > ) >> ) > ) >
定義輸出之投射的對應運算式。
傳回值
型別:Microsoft.ComplexEventProcessing.Linq. . :: . .CepStream< (Of < ( <'TResult> ) > ) >
結果為外部與內部資料流交叉聯結的資料流。
使用注意事項
在 Visual Basic 及 C# 中,您可以在任何型別 CepStream< (Of < ( <'TInput> ) > ) > 的物件上將這個方法做為執行個體方法呼叫。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱 https://msdn.microsoft.com/zh-tw/library/bb384936(v=sql.105) 或 https://msdn.microsoft.com/zh-tw/library/bb383977(v=sql.105)。
備註
請注意,即使在交叉聯結中,仍然只會比對內部和外部資料流中的事件,而且如果它們的存留期間重疊,就會輸出成為聯結的結果。如需詳細資訊,請參閱<聯結>。
範例
在下列範例中,stream1 中 i 裝載欄位之值大於 3 的事件會與 stream2 中 j 裝載欄位之值小於 10 的事件聯結。
var crossJoin = from e1 in stream1
from e2 in stream2
where e1.i > 3 && e2.j < 10
select new { e1.i, e2.j };