I have the following object:
Line{ String Content; Type type;}
And I have, IQeryable<Line>
lines, which I perform operations against. I selected certain lines where line.Content.Contains('x') = list1
, and now am trying to get to the rest of the lines i.e. lines - list1 and for this am using
list2 = lines.Except(list1);
but that results in list2 = lines
.
Code:
private
IQueryable<Line>
ExtractLines(
IQueryable<Line> allLines,
String keyword,
ref IQueryable<Line> hits)
{
hits = allLines.Where(lx => lx.Content.Contains(keyword));
return allLines.Except(hits);
}
any ideas?