select t1.EntryId, t1.SelectionId, t2.InterviewedCount from t_selection as t1 left join (select SelectionId, count(*) InterviewedCount from t_interviewer group by SelectionId) as t2 on t1.SelectionId = t2.SelectionId where t1.EntryId in (1481, 1414, 283);
このクエリをEntityFrameWorkのクエリ式に書き換えたいのですがやり方がわかりません。
このクエリはt_selectionという選考テーブルにt_interviewerというテーブルを外部結合させ、新たにinterviewerdCountという
選考を担当した人の数をカウントしたカラムを結合させるクエリです。
上の式は新たにテーブルを生成するようなクエリで以下のような実行結果になります。
自身でクエリ式を組み立ててみたのですが var countedTable = (from selection in _base.phoenixDB.t_selection join interviwer in _base.phoenixDB.t_interviewer on selection.SelectionId equals interviwer.SelectionId select new { EntryId = selection.EntryId, SelectionId = selection.SelectionId, InterviewerdCount = }).ToList();
InterviewerdCount =
の箇所をどう組み立ててもエラーが出てしまいますどのように実装すればよいでしょうか?
よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー