var lines1 = from m in _dbContext.OdBoms
join n in _dbContext.OdBomDrawLines on m.DocEntry equals n.DocEntry
where m.Station == station && n.LineStatus!="C"
select new
{
Station = m.Station,
DocEntry = m.DocEntry,
LineNum = n.LineNum,
OdBomId = m.OdBomId,
OdBomName = m.OdBomName,
ProjectId = m.ProjectId,
SideLine = m.SideLine,
Regional = m.Regional,
Equipment = m.Equipment,
DrawingsCode = n.DrawingsCode,
DrawingsName = n.DrawingsName,
ItemCode = "",
ItemName = "",
Material = n.Material,
Size = "",
LeftQty = n.LeftQty,
RightQty = n.RightQty,
Memo = n.Memo
};
var lines2 = from m in _dbContext.OdBoms
join n in _dbContext.OdBomItemLines on m.DocEntry equals n.DocEntry
where m.Station == station && n.LineStatus!="C"
select new
{
Station = m.Station,
DocEntry = m.DocEntry,
LineNum = n.LineNum,
OdBomId = m.OdBomId,
OdBomName = m.OdBomName,
ProjectId = m.ProjectId,
SideLine = m.SideLine,
Regional = m.Regional,
Equipment = m.Equipment,
DrawingsCode = "",
DrawingsName = "",
ItemCode = n.ItemCode,
ItemName = n.ItemName,
Material = "",
Size = n.Size,
LeftQty = n.LeftQty,
RightQty = n.RightQty,
Memo = n.Memo
};
var lines = (from m in lines1 select m).Union(from n in lines2 select n);