我正在尝试从具有唯一权限的列表中选择所有项目。当我加载列表时,ItemCount == 1但是在我加载列表的项目之后,ListItemCollection计数== 0.该应用程序可以完全控制网站集,Web和列表。
var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext);
using (var clientContext = new ClientContext(spContext.SPHostUrl))
{
clientContext.Load(clientContext.Web.Lists,
lists => lists.Include(list => list.Title,
list => list.RootFolder.ServerRelativeUrl,
list => list.Id,
list => list.Hidden,
list => list.BaseTemplate,
list => list.BaseType,
list => list.EffectiveBasePermissions,
list => list.ItemCount,
list => list.HasUniqueRoleAssignments)
.Where(list => list.BaseType == BaseType.DocumentLibrary &&
list.HasUniqueRoleAssignments == true &&
list.Title == "Test Library"));
clientContext.ExecuteQuery();
//clientContext.Web.Lists.FirstOrDefault().ItemCount == 1
var tempItems = clientContext.Web.Lists.FirstOrDefault().GetItems(CamlQuery.CreateAllItemsQuery(100));
clientContext.Load(tempItems);
clientContext.ExecuteQuery();
//tempItems.Count() == 0
}
答案 0 :(得分:-1)
我发现了问题,这是一个许可问题。