This project is read-only.

Get content by taxonomies

Topics: Customizing Orchard, General, Português (Portuguese), Writing modules
Jul 22, 2015 at 8:56 AM
I'm trying to get some content by taxonomies, that are a part of that content/ Here's what I have:
var taxonomyTerms = _taxonomyService.GetTerms(taxonomy.Id).Where(t =>      termsToSearch.Contains(t.Name)).ToList();

var listOfTermsIds= taxonomyTerms.Select(x => x.Id).ToList();
//works well until here, I have my list of terms ids

var originalContentItems = _cm
.Query<GenericContentPart, GenericContentRecord>()
.Join<TermsPartRecord>().Where(l => !l.Terms.Select(t => t.TermRecord.Id).Except(listOfTermsIds).Any()).List();
//this returns no records
I've managed to do this with a foreach, but I want to do the same with an expression.
the problem is that last bit of code doesn't return me any records... :/

Any help?