EF core Dynamic Linq comparing Lists in a where clause

Assuming that Ids in your filterSecondaryConditions has unique values, you can use the following:

 if (filterSecondaryConditions != null && filterSecondaryConditions.Count() > 0)
 {
     query = query.Where(w => w.SecondaryConditions.Count(s => filterSecondaryConditions.Contains(s.Id)) 
       == filterSecondaryConditions.Count());
 }