【发布时间】:2018-05-02 05:44:08
【问题描述】:
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = @"<View Scope='RecursiveAll'>
<Query>
</Query>
</View>";
camlQuery.FolderServerRelativeUrl = folder.ServerRelativeUrl;
ListItemCollection listItems = list.GetItems(camlQuery);
clientContext.Load(listItems);
clientContext.ExecuteQuery();
listItems 正在获取我想使用文件名过滤列表的所有 4 个文件。如果文件名与数据库表文件名匹配,则从 listItems 中排除该项目
例如——
4 files - 1.txt 2.txt 3.txt 4.txt
in `database` table if `1.txt and 2.txt` is present then it will match with listItems filename and need to exclude these two items from listItems.
以上只是一个示例,我有 100 个文件,我需要使用文件名进行比较,如果存在于数据库表中,则从列表中排除。
So we listItems is having only 2 items - 3.txt 4.txt
如何在没有 foreach 循环的情况下实现这一点?有什么我可以使用的,比如 LINQ 或 CamlQuery 吗?
【问题讨论】:
标签: c# sharepoint sharepoint-object-model