Linq_根据条件判断是否启用where条件
原创
©著作权归作者所有:来自51CTO博客作者Hello_Martin的原创作品,请联系作者获取转载授权,否则将追究法律责任
var result = from pd in _context.PickDetails.Include(pd => pd.DeliveryOrderDetail)
join p in _context.Pallets on pd.Pallet_ID equals p.Pallet_ID
where pd.DeliveryOrder_ID == deliveryOrderId
&& p.IsLoadConfirmed == false
&& (fromSetPallet || p.Status == "REQUEST")
&& pd.IsCombined == false
group pd by new {p.Pallet_ID, p.SAP_Pallet_ID, p.LocationCode} into palletGroup
select palletGroup;
and (xx || xxx = xxx)
求人不如求己啊,问了好半天。哎。