var expression = from d in this.db.MS_Depositjoin g in this.db.MS_Gold on d.Account equals g.Accountwhere d.IsDeposit == 1 && d.Status == 1 && g.GoldStatus == 11&& d.CreateTime >= start && d.CreateTime <= end && g.CreateTime >= start && g.CreateTime <= endselect new { Account = d.Account, Deposit = d.MjMoney, Gold = g.MjMoney, CreateTime = d.CreateTime }; 我是這樣寫的,這樣不對(duì)。this.db.MS_Deposit 按條件有1條數(shù)據(jù)。條件為: d.IsDeposit == 1 && d.Status == 1 && d.CreateTime >= start && d.CreateTime <= endthis.db.MS_Gold 按條件有0條數(shù)據(jù)。條件為:g.GoldStatus == 11 && g.CreateTime >= start && g.CreateTime <= end期望查詢出一條數(shù)據(jù):Account=123, Deposit =50, Gold = 0, CreateTime = '2017-1-1'
1 回答

一只萌萌小番薯
TA貢獻(xiàn)1795條經(jīng)驗(yàn) 獲得超7個(gè)贊
你是要left join么?
on .... into tmp
from obj in tmp.DefaultIfEmpty()
where....
添加回答
舉報(bào)
0/150
提交
取消