Created
April 14, 2014 01:26
-
-
Save aaronpowell/10609659 to your computer and use it in GitHub Desktop.
Umbraco document types grouped by the count of pages that use it (run via LINQPad)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(from dt in CmsDocumentTypes | |
join n in UmbracoNodes on dt.ContentTypeNodeId equals n.Id | |
select new { | |
n.Id, | |
n.Text, | |
Docs = CmsContents.Where(c => c.ContentType == n.Id).Where(c => !c.Node.Trashed).Count(), | |
IsNested = n.ParentID != -1 | |
}) | |
.Distinct() | |
.GroupBy(x => x.Docs) | |
.Select(x => new { | |
x.Key, | |
Value = x.OrderBy(y => y.IsNested).ThenBy(y => y.Id) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment