score:6

Accepted answer

assuming you've got one-to-many association between candidates and candidatelocations

context.candidates.where(c => c.isarchived == 0 &&
!c.candidatelocations.any(
    l => l.countryisocode == location && l.restrictionstatus == 2) &&
(c.candidatelocations.any(
    l => l.countryisocode == location && l.restrictionstatus == 1) ||
!c.candidatelocations.any(
    l => l.restrictionstatus == 1))
);

Related Query