public Document[] GetLibraryDocumentsById(int libraryId) { List <Document> docs = new List <Document>(); PolicyDocumentCollection policyDocuments = new PolicyDocumentCollection(); PredicateExpression pe = new PredicateExpression(PolicyDocumentFields.LibraryId == libraryId); SortExpression se = new SortExpression(PolicyDocumentFields.Name | SortOperator.Ascending); policyDocuments.GetMulti(pe, 0, se); foreach (PolicyDocumentEntity doc in policyDocuments) { Document wdoc = new Document(); wdoc.Name = doc.Name; wdoc.Id = doc.Id; docs.Add(wdoc); } return(docs.ToArray()); }
public Document[] GetLibraryDocuments(string libraryName) { List<Document> docs = new List<Document>(); PolicyDocumentCollection policyDocuments = new PolicyDocumentCollection(); RelationCollection rels = new RelationCollection(PolicyDocumentEntity.Relations.LibraryEntityUsingLibraryId); PredicateExpression pe = new PredicateExpression(LibraryFields.Name == libraryName); SortExpression se = new SortExpression(PolicyDocumentFields.Name | SortOperator.Ascending); policyDocuments.GetMulti(pe, 0, se, rels); foreach (PolicyDocumentEntity doc in policyDocuments) { Document wdoc = new Document(); wdoc.Name = doc.Name; wdoc.Id = doc.Id; docs.Add(wdoc); } return docs.ToArray(); }