Try our conversational search powered by Generative AI!

Class ContentTypeDB

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

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: 9.12.2
Syntax
[ServiceConfiguration]
public class ContentTypeDB

Constructors

ContentTypeDB(IDatabaseHandler, IPropertyDefinitionRepository, IPropertySettingsRepository, ContentTypeModelRepository, DatabaseDateTimeHandler)

Initializes a new instance of the ContentTypeDB class.

Declaration
[Obsolete("Use another constructor")]
public ContentTypeDB(IDatabaseHandler databaseHandler, IPropertyDefinitionRepository propertyDefinitionRepository, IPropertySettingsRepository settingsRepository, ContentTypeModelRepository contentTypeModelRepository, DatabaseDateTimeHandler dateTimeHandler)
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.

DatabaseDateTimeHandler dateTimeHandler

The database datetime handler

Remarks

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

ContentTypeDB(IDatabaseHandler, IPropertyDefinitionRepository, IPropertySettingsRepository, ContentTypeModelRepository, DatabaseDateTimeHandler, ISynchronizedObjectInstanceCache, IPrincipalAccessor)

Initializes a new instance of the ContentTypeDB class.

Declaration
public ContentTypeDB(IDatabaseHandler databaseHandler, IPropertyDefinitionRepository propertyDefinitionRepository, IPropertySettingsRepository settingsRepository, ContentTypeModelRepository contentTypeModelRepository, DatabaseDateTimeHandler dateTimeHandler, ISynchronizedObjectInstanceCache cacheInstance, IPrincipalAccessor principalAccessor)
Parameters
Type Name Description
IDatabaseHandler databaseHandler
IPropertyDefinitionRepository propertyDefinitionRepository
IPropertySettingsRepository settingsRepository
ContentTypeModelRepository contentTypeModelRepository
DatabaseDateTimeHandler dateTimeHandler
ISynchronizedObjectInstanceCache cacheInstance
IPrincipalAccessor principalAccessor
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