Reputation: 350
I'm working on some C# code that performs tasks based on certain documents. Currently, I'm using Document[] releaseDocs = Document.GetRootDocuments()
and then looping through the results.
Is it possible to do something like Document[] releaseDocs = Document.GetRootDocuments().Where(m => m.Published == false);
where I could take advantage of the API to only get Published Documents and Documents with certain set Variables? If so, how, because that method doesn't appear to work.
Upvotes: 1
Views: 85
Reputation: 10922
This should work just fine:
Document[] releaseDocs = Document.GetRootDocuments().Where(m =>
m.Published == false &&
m.getProperty("SomeAlias").Value.Equals("Some Value")).ToArray();
Upvotes: 2
Reputation: 1178
Try something like this:
Document[] documents = Document.GetRootDocuments();
foreach (var doc in documents)
{
// Do Something
}
Upvotes: 2