Taxnonmies query help please!

Topics: Customizing Orchard, Writing modules
Dec 18, 2012 at 8:32 PM

I need such query

var t = _services.ContentManager.Query("MyType")
                .Where<TermsPartRecord>(a => a.Terms.Any(b => b.TermRecord.TaxonomyId == taxonomyId && b.TermRecord.Path == "/"))
                 .Where<TitlePartRecord>(a => a.Title.Contains(Term))

 

In result the query checkes Title of the "MyType" ContentType.

But  how to query Tile of the Taxonomy Term?

Pleas help who knows?

I'll appreciate any clue.

Coordinator
Dec 18, 2012 at 9:45 PM

Can you explain what exact query you're trying to create? Do you want to filter on both your title and the term title or just on the term title?

Dec 19, 2012 at 7:36 AM

Thank you for quick reply first!

I need to query only by Title of the term.  I do not need the title of the ContentType (Mytype)

that is something like .Where<TermsPartRecord>(a => a.Title.Contains(Term) && a.Terms.Any(b => b.TermRecord.TaxonomyId == taxonomyId &&

Coordinator
Dec 19, 2012 at 6:37 PM

Maybe query the terms first, and then get the items that have the resulting terms?