{"action":"created","issue":{"url":"https://api.github.com/repos/AffinityID/uMigrate/issues/39","repository_url":"https://api.github.com/repos/AffinityID/uMigrate","labels_url":"https://api.github.com/repos/AffinityID/uMigrate/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/AffinityID/uMigrate/issues/39/comments","events_url":"https://api.github.com/repos/AffinityID/uMigrate/issues/39/events","html_url":"https://github.com/AffinityID/uMigrate/issues/39","id":149897498,"number":39,"title":"It would be nice to have AllowChild and DisallowChild methods on ContentType","user":{"login":"Myster","id":354777,"avatar_url":"https://avatars.githubusercontent.com/u/354777?v=3","gravatar_id":"","url":"https://api.github.com/users/Myster","html_url":"https://github.com/Myster","followers_url":"https://api.github.com/users/Myster/followers","following_url":"https://api.github.com/users/Myster/following{/other_user}","gists_url":"https://api.github.com/users/Myster/gists{/gist_id}","starred_url":"https://api.github.com/users/Myster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Myster/subscriptions","organizations_url":"https://api.github.com/users/Myster/orgs","repos_url":"https://api.github.com/users/Myster/repos","events_url":"https://api.github.com/users/Myster/events{/privacy}","received_events_url":"https://api.github.com/users/Myster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-20T21:55:28Z","updated_at":"2016-04-20T22:06:27Z","closed_at":null,"body":"Example suggested usage passing the alias of the ContentType to allow or disallow:\r\n\r\n```\r\nContentTypes.Where(x => x.Alias == \"LandingPage\")\r\n\t.DisallowChild(\"SpecialListingPage\");\r\n\r\nContentTypes.Where(x => x.Alias == \"SpecialLandingPage\")\r\n\t.AllowChild(\"SpecialListingPage\");\r\n```"},"comment":{"url":"https://api.github.com/repos/AffinityID/uMigrate/issues/comments/212629147","html_url":"https://github.com/AffinityID/uMigrate/issues/39#issuecomment-212629147","issue_url":"https://api.github.com/repos/AffinityID/uMigrate/issues/39","id":212629147,"user":{"login":"Myster","id":354777,"avatar_url":"https://avatars.githubusercontent.com/u/354777?v=3","gravatar_id":"","url":"https://api.github.com/users/Myster","html_url":"https://github.com/Myster","followers_url":"https://api.github.com/users/Myster/followers","following_url":"https://api.github.com/users/Myster/following{/other_user}","gists_url":"https://api.github.com/users/Myster/gists{/gist_id}","starred_url":"https://api.github.com/users/Myster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Myster/subscriptions","organizations_url":"https://api.github.com/users/Myster/orgs","repos_url":"https://api.github.com/users/Myster/repos","events_url":"https://api.github.com/users/Myster/events{/privacy}","received_events_url":"https://api.github.com/users/Myster/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T22:06:27Z","updated_at":"2016-04-20T22:06:27Z","body":"I've found this old extension method I wrote for AllowChild\r\n\r\n```\r\n\t\tpublic static IContentTypeSetSyntax AllowChild(this IContentTypeFilteredSetSyntax syntax, string childContentTypeAlias)\r\n\t\t{\r\n\t\t\treturn syntax.Change(ct =>\r\n\t\t\t{\r\n\t\t\t\tvar childContentType = ApplicationContext.Current.Services.ContentTypeService.GetContentType(childContentTypeAlias);\r\n\t\t\t\tct.AllowedContentTypes = ct.AllowedContentTypes.Union(new[] { new ContentTypeSort {\r\n                        Id = new Lazy<int>(() => childContentType.Id),\r\n                        Alias = childContentType.Alias,\r\n                        SortOrder = 0\r\n                    }});\r\n\t\t\t});\r\n\t\t}\r\n```\r\n\r\nAnd this for Disallow:\r\n\r\n```\r\n\t\tpublic static IContentTypeSetSyntax DisallowChild(this IContentTypeFilteredSetSyntax syntax, string childContentTypeAlias)\r\n        {\r\n            return syntax.Change(ct =>\r\n            {\r\n                ct.AllowedContentTypes = ct.AllowedContentTypes.Where(x => x.Alias != childContentTypeAlias);\r\n            });\r\n        }\r\n```\r\n"}}