///查詢每個月需要用膳的數目
///GroupJoin
by CheckInOn月份,
var
B = db.Reservations.Where(x => x.IsDinner == true);
var
_dinnerInfo = A.GroupJoin( B,
x => x, //母體A的join key
y =>
y.CheckInOn.Month, //子體B的join key
(x,
y) =>
new
{
Month = x,
IsDinner = "需要用餐的訂房數",
Count = y.Count()
});
沒有留言:
張貼留言