使用linq获得当前文件夹下的下一级满足条件的文件夹

时间:2020-12-08 12:12:55

使用linq获得当前文件夹下的下一级满足条件的文件夹。
            SPFolderCollection subAlbums = Folder.SubFolders;
            var lstSubAlbums = from SPFolder f in subAlbums
                               where f.Name != "_t" && f.Name != "_w" && f.Name != "Forms"   //注意先后顺序,"_t"没有Item["_ModerationStatus"]属性                        
                               && f.Item["_ModerationStatus"].ToString() == "0"
                               && f.Files.Count > 0
                               orderby f.Item["Created"] descending
                               select f;

            var pageAlbums = (from SPFolder pf in lstSubAlbums select pf)
                                .Skip((aspnetpagerFile.CurrentPageIndex - 1) * aspnetpagerFile.PageSize)
                                .Take(aspnetpagerFile.PageSize).ToList();