I need to get all documents from Sharepoint site. I start with getting all the document libraries:
private IEnumerable<List> GetAllDocumentLibraries(ClientContext context)
{
var lists = context.LoadQuery(context.Web.Lists.Where(list => list.BaseType == BaseType.DocumentLibrary));
context.ExecuteQuery();
return lists;
}
And then get all the items from each..
var items = list.GetItems(CamlQuery.CreateAllItemsQuery());
_context.Load(items, i => i.Include(it => it.DisplayName, it => it.File));
_context.ExecuteQuery();
Problem is that there is a lot of system libraries that return files such as "controls", "edit-mode-21" and similar. I don't want to filter them out by specific names, since there could be other on another SP sites.
How can I know from the List
and its properties if it is user-created list (meaning with documents that I need) or just a sys. library?
Thanks