I want to filter a grand child based on parent. I’m not sure how to reference back to the parent when using a ThenInclude.
I only want to bring in the joined grandchildren if that condition exists on the parent.
Looking to do something like this, I’m just not sure how I can referrence back the parent property.
_context.Parent.Include(w => w.Child)
.ThenInclude(t => t.Grandchild.Where(g => g.Conditions.Any(c => c.Condition.Contains('I want to reference back to parent or child to filter here')))
Is this possible? Is it possible in query syntax instead of method syntax?