GetAllContentList() static private method

static private GetAllContentList ( CarrotCMSDataContext ctx, Guid siteID ) : IQueryable
ctx CarrotCMSDataContext
siteID Guid
return IQueryable
        public void FixOrphanPages(Guid siteID)
        {
            List <SiteMapOrder> lstContent = CannedQueries.GetAllContentList(db, siteID).Select(ct => new SiteMapOrder(ct)).ToList();
            List <Guid>         lstIDs     = lstContent.Select(x => x.Root_ContentID).ToList();

            lstContent.RemoveAll(x => x.Parent_ContentID == null);
            lstContent.RemoveAll(x => lstIDs.Contains(x.Parent_ContentID.Value));

            lstIDs = lstContent.Select(x => x.Root_ContentID).ToList();

            IQueryable <carrot_Content> querySite = (from c in db.carrot_Contents
                                                     where c.IsLatestVersion == true &&
                                                     c.Parent_ContentID != null &&
                                                     lstIDs.Contains(c.Root_ContentID)
                                                     select c);

            db.carrot_Contents.BatchUpdate(querySite, p => new carrot_Content {
                Parent_ContentID = null
            });

            IQueryable <carrot_Content> querySite2 = (from c in db.carrot_Contents
                                                      join rc in db.carrot_RootContents on c.Root_ContentID equals rc.Root_ContentID
                                                      where c.IsLatestVersion == true &&
                                                      c.Parent_ContentID != null &&
                                                      rc.SiteID == siteID &&
                                                      rc.ContentTypeID == ContentPageType.GetIDByType(ContentPageType.PageType.BlogEntry)
                                                      select c);

            db.carrot_Contents.BatchUpdate(querySite2, p => new carrot_Content {
                Parent_ContentID = null
            });

            db.SubmitChanges();
        }
        public List <SiteMapOrder> GetSiteFileList(Guid siteID)
        {
            List <SiteMapOrder> lstContent = CannedQueries.GetAllContentList(db, siteID).Select(ct => new SiteMapOrder(ct)).ToList();

            return(lstContent);
        }