Здравствуйте, я должен отфильтровать множество таблиц.пример;
public class LanguageSchool
{
public long Id { get; set; }
public virtual List<LanguageSchoolLanguageSchoolProgram> LanguageSchoolLanguageSchoolPrograms { get; set; }
}
public class LanguageSchoolProgram
{
public long Id { get; set; }
public virtual List<LanguageSchoolLanguageSchoolProgram> LanguageSchoolLanguageSchoolPrograms { get; set; }
}
public class LanguageSchoolLanguageSchoolProgram
{
public long LanguageSchoolProgramId { get; set; }
public virtual LanguageSchoolProgram LanguageSchoolProgram { get; set; }
public long LanguageSchoolId { get; set; }
public virtual LanguageSchool LanguageSchool { get; set; }
}
и запрос;
List<long> selectedLanguageEducationIds = [1,2,4,6]
foreach (var education in langEducations)
{
var list = context.LanguageSchools
.Where(x => x.LanguageSchoolLanguageEducations
.Contains(new LanguageSchoolLanguageEducation() {
LanguageEducation = education,
LanguageSchool = x,
LanguageEducationId = education.Id,
LanguageSchoolId = x.Id
})
).ToList();
}
, но этот код не работает.Мой вопрос заключается в том, как я могу искать / фильтровать / запрашивать многие свойства.