My intersect in LINQ somehow dont seem to work. I have two excel sheets. I fetch it using LinQToExcel and (LinQToExcel does not support VisitSubQueryExpression i have to do some extra work).
List<BoardSheet> sourceTest = (from t in Boards[0]
where t["Board"] == boardName
select new CircuitSet
{
ID = string.Format(t["ID"]),
Data = string.Format(t["Data"]),
CtrlType = string.Format(t["CtrlType"]),
sys = string.Format(t["sys"]),
code = string.Format(t["code"])
}
).ToList<BoardSheet>();
List<BoardSheet> targetTest = (from t in Boards[0]
where t["Board"] == boardName
select new CircuitSet
{
ID = string.Format(t["ID"]),
Data = string.Format(t["Data"]),
CtrlType = string.Format(t["CtrlType"]),
sys = string.Format(t["sys"]),
code = string.Format(t["code"])
}
).ToList<BoardSheet>();
IEnumerable<BoardSheet> board = sourceTest.Intersect(targetTest);
board's count always returns 0. But when i iterate thro the field values of sourceTest and targetSet i see common field values.