Try our conversational search powered by Generative AI!

Class ContentTypeDB

Database class for ContentType. This class supports the EPiServer infrastructure and is not intended to be used directly from your code.

Inheritance
System.Object
ContentTypeDB
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAccess
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[ServiceConfiguration]
public class ContentTypeDB

Constructors

ContentTypeDB(IDatabaseHandler, IPropertyDefinitionRepository, IPropertySettingsRepository, ContentTypeModelRepository)

Initializes a new instance of the ContentTypeDB class.

Declaration
public ContentTypeDB(IDatabaseHandler databaseHandler, IPropertyDefinitionRepository propertyDefinitionRepository, IPropertySettingsRepository settingsRepository, ContentTypeModelRepository contentTypeModelRepository)
Parameters
Type Name Description
IDatabaseHandler databaseHandler

The IDatabaseHandler that will be used for database communication.

IPropertyDefinitionRepository propertyDefinitionRepository

The IPropertyDefinitionRepository that will be used to retrieve property definitions.

IPropertySettingsRepository settingsRepository

The IPropertySettingsRepository that will be used to retrieve property settings.

ContentTypeModelRepository contentTypeModelRepository

The content type model repository.

Remarks

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Methods

ClearCache()

Clears the cache.

Declaration
public static void ClearCache()

Delete(ContentType)

Deletes a ContentType from the data repository.

Declaration
public virtual void Delete(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

List()

Lists all ContentTypes in the data repository.

Declaration
public virtual IEnumerable<ContentType> List()
Returns
Type Description
System.Collections.Generic.IEnumerable<ContentType>

Enumeration of ContentTypes.

OnModelTypeChanged(ContentType)

Declaration
protected static void OnModelTypeChanged(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

OnRepositoryUpdated(ContentType, RepositoryEventType)

Called to raise the repository updated event

Declaration
protected static void OnRepositoryUpdated(ContentType contentType, RepositoryEventType eventType)
Parameters
Type Name Description
ContentType contentType

Type of the content.

RepositoryEventType eventType

Type of the event.

Save(ContentType)

Saves the specified content type to the data repository.

Declaration
public virtual void Save(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

The content type to save.

Remarks

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

SaveIncludingPropertyDefinitions(ContentType)

Saves the content type and all its property definitions.

Declaration
public virtual int SaveIncludingPropertyDefinitions(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

The content type.

Returns
Type Description
System.Int32

A copy of the content type, including its property definitions.

Events

ModelTypeChanged

Declaration
public static event EventHandler<RepositoryEventArgs> ModelTypeChanged
Event Type
Type Description
System.EventHandler<RepositoryEventArgs>

RepositoryUpdated

Declaration
public static event EventHandler<RepositoryEventArgs> RepositoryUpdated
Event Type
Type Description
System.EventHandler<RepositoryEventArgs>

Extension Methods