I created this sample project where I am trying to remove sub data using the Where and Any but it still contains the data. It should remove the DD notes and just keep the CC notes.
Any help on this would be great.
TemplateNote = TemplateNote.Where(x =>
x.Content == "AA" &&
x.Conditions.Any(v => v.Target != removeAgentDisease)
).ToList();
https://dotnetfiddle.net/a3d6Py
current Output includes the DD notes
TemplateNote AA
TemplateNoteCondition CC
TemplateNoteCondition DD
Should be this without the DD
TemplateNote AA
TemplateNoteCondition CC