1
  1. このようにデータベースからデータを取得します。

     Dim query = From t1 In TBL1 _
                 Join t2 In TBL2 On t1.ID Equals t2.ID _
                 Join t3 In TBL3 On t1.ID Equals t3.ID _
                 Group Join t4 In t1 _
                       On t1.ID Equals t4.ID _
                       Into t4_Grp = Group _
                 Select t1, t2, t3, t4_Grp
    
  2. ユーザーが検索を実行すると、このようにクエリ結果をフィルタリングできます。

    query = query.Where(Function(o) o.t1.ID = lngID)
    
  3. 上記のすべてが正常に動作します。t4_Grpをラムダ化したいまで。t4_Grp でラムダ式を実行する方法がわかりません。

4

1 に答える 1

0

過去にこれを使用して、パワーグループ化を行いました。

private void ProducePivotAnalytic <T, K>(IEnumerable<T> colletion, Func<T, K> pivot)
{
    var grouped =
        from n in colletion
            group n by pivot(n) into g
            select new { theKey = g.Key, theValue = g };
    // do some stuff with your grouped collection.
}


ProducePivotAnalytic<List<DateTime>, DayOfWeek>(
        myDates,
            (x) => (x.DayOfWeek) );
于 2011-08-25T15:59:37.233 に答える