Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Interface IContentModelUsage

Defines signatures for the component that handles usage information about content models.

Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public interface IContentModelUsage

Methods

IsContentTypeUsed(ContentType)

Performs a check if specified ContentType is used.

This method is for example called before a content type defined in code is deleted.

Declaration
bool IsContentTypeUsed(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

The contentType to return references for.

Returns
Type Description
System.Boolean

IsPropertyDefinitionUsed(PropertyDefinition)

Performs a check if specified PropertyDefinition is used.

This method is for example called before a property definition type defined in code is deleted.

Declaration
bool IsPropertyDefinitionUsed(PropertyDefinition propertyDefinition)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The property definition.

Returns
Type Description
System.Boolean

true if property definition is used; otherwise, false.

ListContentOfContentType(ContentType)

Gets a list of references to contents of specified ContentType.

This method is for example called before a content type defined in code is deleted.

Declaration
IList<ContentUsage> ListContentOfContentType(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

The contentType to return references for.

Returns
Type Description
System.Collections.Generic.IList<ContentUsage>

ListContentWithPropertyDefinition(PropertyDefinition, Boolean, Boolean)

Gets the contents with instance of content definition.

This method is for example called before a content definition defined in code is deleted.

Declaration
IList<ContentUsage> ListContentWithPropertyDefinition(PropertyDefinition propertyDefinition, bool onlyNoneMasterLanguage, bool onlyPublished)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The property definition.

System.Boolean onlyNoneMasterLanguage

if set to true only none master langauge are taken into account.

System.Boolean onlyPublished

if set to true only published versions are taken into account.

Returns
Type Description
System.Collections.Generic.IList<ContentUsage>

Extension Methods