score:6

this query will return all categories that have at least one course that is active:

var categories = db.categories
    .where(x => x.courses.any(y => y.isactive))
    .tolist();

this query will return all categories whose courses are all active. if, for example, a category has two courses and one of the courses is inactive, that category will be excluded from the query:

var categories = db.categories
    .where(x => x.courses.all(y => y.isactive))
    .tolist();

Related Query

More Query from same tag