linq join的lambda写法

 var query = _db.Bank_CommercialOpus

.Join(_db.Bank_Opus, s => s.OpusID, Opus => Opus.ID, (s, Opus) => new { ID = s.ID, CompanyName = s.CompanyName, ChannelAddress = s.ChannelAddress, CpAddress = s.CpAddress, OpusID = s.OpusID, Oupsname = Opus.OpTitle, AddTime = s.AddTime, IsDelete = s.IsDelete })

.Where(s => s.IsDelete == false)

.Select(s => new Bank_CommercialOpus { ID = s.ID, CompanyName = s.CompanyName, ChannelAddress = s.ChannelAddress, CpAddress = s.CpAddress, OpusID = s.OpusID, Oupsname = s.Oupsname, AddTime = s.AddTime, IsDelete = s.IsDelete }).OrderBy(s => s.AddTime);

 

posted @ 2014-04-08 21:39  ``炯``  阅读(5530)  评论(0编辑  收藏  举报