Your code will return the
FileInformation
object if it has any
ChangeInformation
object with status not as Deleted.
Now, if an object has statuses as changed and delete, it will be returned. I will recommend changing it to this:
Here, we are checking if any status is deleted. If yes,
do not take it.
var files = finfo.Where(n => !n.ChangeInformations.Any(x=>x.Status == "Deleted");
If deleted is always going to be on top and
ChangeInformation
is sorted in descending order of date, you can just check the first item if the status is deleted. If not select it. Something like this:
finfo.Where(x =>
(x.ChangeInformations != null && x.ChangeInformations.Count > 0 && x.ChangeInformations[0].Status != "Deleted")
);