日期:2014-05-20 浏览次数:20794 次
var query=from p in _context.ShippingOrderHistory
where p.FromPT==FromPT&&p.OrderId==OrderID&&p.TrcakingGroup==0
请问其他的条件怎么写?
var query=(from p in _context.ShippingOrderHistory
where p.FromPT==FromPT&&p.OrderId==OrderID&&p.TrcakingGroup==0
group p by p.ShippingGroup into g
orderby g.Key
select g).FirstOrDefault();
//lamda
var query= _context.ShippingOrderHistory.Where(x=>x.TrcakingGroup == 0 && FromPT == FromPT && OrderId =OrderID)
.GroupBy(x=>x.ShippingGroup)
.OrderBy(g=>g.Key)
.Select(g=>g).FirstOrDefault();