Skip to content

Instantly share code, notes, and snippets.

@ps-team
Created April 7, 2015 14:06
Show Gist options
  • Save ps-team/e958ddf9c04555a614b2 to your computer and use it in GitHub Desktop.
Save ps-team/e958ddf9c04555a614b2 to your computer and use it in GitHub Desktop.
var newsArticleQuery = Query.Where("SC_T_ID").IsEqualTo("-1234”); // only return news articles based on template ID
var newsQuery = newsArticleQuery; //this is so we can add a subquery
if (!String.IsNullOrEmpty(category))
{
var categorySubQuery = SubQuery.Where("Md_Category").IsEqualTo(category);
newsQuery = newsQuery.AndSubQuery(categorySubQuery );
}
var finalQuery = new NodeFinder().Find(newsQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment