我有两张桌子
**table 1**
int tid
money money
datetime date
int serviceid
int type
**table2**
int id
int tid
status nvarchr()
我使用Ef4,我拥有两个实体的导航财产
i 试图在日期前得到钱财集团的金额 [我也做了一个新等级 具有这种属性]
Total money
Total money of type [1]
total money where table2 status is a or b
how can I achieve that king of query THIS IS WHAT I GOT SO FAR :
return db.TBL1.Include("TBL2").Where(x => x.date >= startDate && x.date <= endDate && x.ServiceID == sid).GroupBy(e => new { e.Date.Value.Year, e.Date.Value.Month, e.Date.Value.Day }).AsEnumerable().Select(group => new entity c (Convert.ToInt32(group.Sum(x => x.Money)), Convert.ToInt32(group.Where(d => d.BillingType == 1).Sum(x => x.Money)),********what can i do here*****, Convert.ToDateTime(group.FirstOrDefault().Date))).AsEnumerable<billingReport>().ToList();