SaaS CMS has officially launched! Learn more now.

Class ContentTypeDB

Inheritance
System.Object
ContentTypeDB
Namespace: EPiServer.DataAccess.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
public class ContentTypeDB : Object

Constructors

ContentTypeDB()

Declaration
protected ContentTypeDB()

ContentTypeDB(ServiceAccessor<IDatabaseExecutor>, IPropertyDefinitionRepository, IPropertySettingsRepository, DatabaseDateTimeHandler, ISynchronizedObjectInstanceCache, IPrincipalAccessor, IContentTypeBaseResolver, IContentModelUsage, IPropertyDefinitionTypeRepository)

Initializes a new instance of the ContentTypeDB class.

Declaration
public ContentTypeDB(ServiceAccessor<IDatabaseExecutor> databaseHandlerAccessor, IPropertyDefinitionRepository propertyDefinitionRepository, IPropertySettingsRepository settingsRepository, DatabaseDateTimeHandler dateTimeHandler, ISynchronizedObjectInstanceCache cacheInstance, IPrincipalAccessor principalAccessor, IContentTypeBaseResolver contentTypeBaseResolver, IContentModelUsage contentModelUsage, IPropertyDefinitionTypeRepository propertyDefinitionTypeRepository)
Parameters
Type Name Description
ServiceAccessor<IDatabaseExecutor> databaseHandlerAccessor
IPropertyDefinitionRepository propertyDefinitionRepository
IPropertySettingsRepository settingsRepository
DatabaseDateTimeHandler dateTimeHandler
ISynchronizedObjectInstanceCache cacheInstance
IPrincipalAccessor principalAccessor
IContentTypeBaseResolver contentTypeBaseResolver
IContentModelUsage contentModelUsage
IPropertyDefinitionTypeRepository propertyDefinitionTypeRepository
Remarks

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

Fields

UseContentTypeSavedByKey

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

Declaration
public const string UseContentTypeSavedByKey = "ContentTypeRepository:SavedBy"
Field Value
Type Description
System.String

UseContentTypeSavedKey

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

Declaration
public const string UseContentTypeSavedKey = "ContentTypeRepository:Saved"
Field Value
Type Description
System.String

Properties

UseContentTypeSaved

Indicates whether save time is taken from ContentType instance or set by the save method. If true Saved property on ContentType instance is used else time is set to DateTime.Now.

Declaration
public static bool UseContentTypeSaved { get; }
Property Value
Type Description
System.Boolean

UseContentTypeSavedBy

Indicates whether saved by is taken from ContentType instance or set by the save method. If true SavedBy property on ContentType instance is used else current user.

Declaration
public static bool UseContentTypeSavedBy { get; }
Property Value
Type Description
System.Boolean

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.

Save(IEnumerable<ContentType>)

Declaration
public virtual void Save(IEnumerable<ContentType> contentTypes)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ContentType> contentTypes

SaveCopyWithProperties(ContentType)

Saves the content type and all its property definitions.

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

The content type.

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