I am using a lamda expression to filter a query.
Basically, I have lines that are composed of segments and these segments are marked as deleted, inserted or null.
What I want returned are segments that have been marked as deleted but whose any sibling IS NOT marked as deleted. As an example,
Line: "Soylent Green is people!" Broken into 2 segments...
Segment 1: "Soylent Green " (marked as deleted)
Segment 2: "is people!" (not marked as deleted)
Should return me Segment 1. But the next example,
Line: "Open the pod bay doors Hal!" Broken into 3 segments...
Segment 1: "Open the " (marked as deleted)
Segment 2: "pod bay " (marked as deleted)
Segment 3: "doors Hal!" (marked as deleted)
Should not return any segments. See code below:
return seg => seg.ModType == Deleted &&
seg.Line.Segments.Any(segs => segs.ID != seg.ID &&
segs.ModType != Deleted);
Thanks and I appreciate any help or suggestion as to why this is not working.