Getting list of documents from a specific library
Hi
How can I get list of documents from only a specific document library? I understand its something on these lines;
List<Telerik.Sitefinity.Libraries.Model.Document> list;
list =
App.WorkWith().Documents().Where( ??? ).Get().ToList();
I don’t know what comes instead of ??? though.
If I try this;
list = App.WorkWith().Documents().Where(d => d.Status ==
Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live).Get().ToList();
I get documents from all libraries not just one specific library.
What is the solution?
Thanks
Regards
Give this a try:
IEnumerable<Document> documents = App.WorkWith().DocumentLibrary(
this
.LibraryId)
.Documents()
.Where(d => d.Status == ContentLifecycleStatus.Live)
.OrderByDescending(d => d.UrlName)
.Get()
.ToList();