Retrieving content types
Getting a single content type
// Declare the GUID ID
Guid guid = new Guid("796a8d5c-b7bb-46d9-bc57-ab834d0d1248");
// Get a reference to the content type by its GUID ID
IContentType contentType = _contentTypeService.Get(guid);// Get a reference to the content type by its numeric ID
IContentType contentType = _contentTypeService.Get(1234); // Get a reference to the content type by its alias
IContentType contentType = _contentTypeService.Get("home");Getting a list of content types
// Get a collection of all content types
IEnumerable<IContentType> contentTypes = _contentTypeService.GetAll();Check whether a content type has children
Last updated
Was this helpful?