0
from objPt in lstTicketPrintingTrack    
join objtransDetail in lstTrans 
  on new { t1 = objPt._id, t2 = } equals new { t1 = objtransDetail._id, t2 = }
select new { name = objPt.GetValue("_id").GetIntValue() }

This is my linq join. lstTicketPrintingTrack , lstTrans is a List of BsonDocuments.

in lstTicketPrintingTrack a filed : - seq is in array seq : [2,3,5]

in objtransDetail a field : - transSeq = 3 (just a integer value)

I need to check whether seq : [2,3,5] contains transSeq in join

If it contains i need that row else skip.

apart from this two lists i have some other lists also to join with the same.

how to achieve this...

4

1 回答 1

0

我希望我清楚地理解你的问题,但我认为你的意思是这样的:

var result = from objPt in lstTicketPrintingTrack    
             join objtransDetail in lstTrans 
             on new { t1 = objPt._id, t2 = } equals new { t1 = objtransDetail._id, t2 = }

             where objPt.Seg.Contains(objtransDetail.transSeq)
             select new { name = objPt.GetValue("_id").GetIntValue() };
于 2013-09-19T08:25:51.417 回答