Interface IContentTypeComposition
Defines the Composition of a ContentType
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public interface IContentTypeComposition : IContentTypeBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirtyProperties
View SourceCompositionPropertyGroups
Gets the property groups for the entire composition.
Declaration
IEnumerable<PropertyGroup> CompositionPropertyGroups { get; }Property Value
| Type | Description | 
|---|---|
| IEnumerable<PropertyGroup> | 
CompositionPropertyTypes
Gets the property types for the entire composition.
Declaration
IEnumerable<IPropertyType> CompositionPropertyTypes { get; }Property Value
| Type | Description | 
|---|---|
| IEnumerable<IPropertyType> | 
ContentTypeComposition
Gets or sets the content types that compose this content type.
Declaration
IEnumerable<IContentTypeComposition> ContentTypeComposition { get; set; }Property Value
| Type | Description | 
|---|---|
| IEnumerable<IContentTypeComposition> | 
RemovedContentTypes
Returns a list of content type ids that have been removed from this instance's composition
Declaration
IEnumerable<int> RemovedContentTypes { get; }Property Value
| Type | Description | 
|---|---|
| IEnumerable<System.Int32> | 
Methods
View SourceAddContentType(IContentTypeComposition)
Adds a new ContentType to the list of composite ContentTypes
Declaration
bool AddContentType(IContentTypeComposition contentType)Parameters
| Type | Name | Description | 
|---|---|---|
| IContentTypeComposition | contentType | IContentType to add | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | True if ContentType was added, otherwise returns False | 
CompositionAliases()
Gets a list of ContentType aliases from the current composition
Declaration
IEnumerable<string> CompositionAliases()Returns
| Type | Description | 
|---|---|
| IEnumerable<System.String> | An enumerable list of string aliases | 
CompositionIds()
Gets a list of ContentType Ids from the current composition
Declaration
IEnumerable<int> CompositionIds()Returns
| Type | Description | 
|---|---|
| IEnumerable<System.Int32> | An enumerable list of integer ids | 
CompositionKeys()
Gets a list of ContentType keys from the current composition
Declaration
IEnumerable<Guid> CompositionKeys()Returns
| Type | Description | 
|---|---|
| IEnumerable<Guid> | An enumerable list of integer ids. | 
ContentTypeCompositionExists(String)
Checks if a ContentType with the supplied alias exists in the list of composite ContentTypes
Declaration
bool ContentTypeCompositionExists(string alias)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | alias | Alias of a IContentType | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | True if ContentType with alias exists, otherwise returns False | 
GetOriginalComposedPropertyTypes()
Gets the property types obtained via composition.
Declaration
IEnumerable<IPropertyType> GetOriginalComposedPropertyTypes()Returns
| Type | Description | 
|---|---|
| IEnumerable<IPropertyType> | 
Remarks
Gets them raw, ie with their original variation.
RemoveContentType(Guid)
Removes a content type with a specified key from the composition.
Declaration
bool RemoveContentType(Guid key)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | key | The key of the content type to remove. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | True if the content type was removed, otherwise false. | 
RemoveContentType(String)
Removes a ContentType with the supplied alias from the list of composite ContentTypes
Declaration
bool RemoveContentType(string alias)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | alias | Alias of a IContentType | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | True if ContentType was removed, otherwise returns False |