Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Class ContentTypeModelRegister

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Synchronizes ContentTypeModels defined in code with ContentTypes stored in the repository.

Inheritance
System.Object
ContentTypeModelRegister
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.DataAbstraction.RuntimeModel.Internal
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
[ServiceConfiguration]
[ServiceConfiguration(typeof(IContentTypeModelRegistrator))]
public class ContentTypeModelRegister : IContentTypeModelRegistrator
Remarks

Model synchronization is automatically performed by this class at site initialization. Please see the examples section for instructions on how you can manually synchronize a content model.

Constructors

ContentTypeModelRegister(ContentTypeSynchronizer, PropertyDefinitionSynchronizer, IContentLoader, ContentModelOptions)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the ContentTypeModelRegister class.

Declaration
public ContentTypeModelRegister(ContentTypeSynchronizer typeSynchronizer, PropertyDefinitionSynchronizer propertyDefinitionSynchronizer, IContentLoader contentLoader, ContentModelOptions contentModelOptions)
Parameters
Type Name Description
ContentTypeSynchronizer typeSynchronizer

The type synchronizer that should be used by this instance.

PropertyDefinitionSynchronizer propertyDefinitionSynchronizer

The property definition synchronizer that should be used by this instance.

IContentLoader contentLoader

The content loader.

ContentModelOptions contentModelOptions

The content model options.

Properties

RunSynchronously

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. If methods should run without parallellism

Declaration
public bool RunSynchronously { get; set; }
Property Value
Type Description
System.Boolean

TypeModels

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the type models that will be used in the Analyze and Commit operations.

Declaration
public IList<ContentTypeModel> TypeModels { get; }
Property Value
Type Description
System.Collections.Generic.IList<ContentTypeModel>

Methods

AnalyzeProperties()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Compares the model's properties to the repository ones

Declaration
public virtual void AnalyzeProperties()

AnalyzeTypes()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the type models properties that will be used in the Analyze of type models properties

Declaration
public virtual void AnalyzeTypes()

CommitProperties(Boolean)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Commits the type models' properties changes detected in the Analyze operation to the repository.

Declaration
public virtual void CommitProperties(bool deleteUnusedTypes)
Parameters
Type Name Description
System.Boolean deleteUnusedTypes

if set to true any types that are no longer used are deleted.

Exceptions
Type Condition
AlreadyInUseException

A definition without an ID, and with a name that already existing definition, tries to be saved.

CommitTypes(Boolean)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Commits any changes detected in the Analyze operation to the repository.

Declaration
public virtual void CommitTypes(bool deleteUnusedTypes)
Parameters
Type Name Description
System.Boolean deleteUnusedTypes

if set to true any types that are no longer used are deleted.

Exceptions
Type Condition
AlreadyInUseException

A definition without an ID, and with a name that already existing definition, tries to be saved.

EnsureContentTypeVersionUpToDate()

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Ensures that if there was changes to a content type or its properties, then the assembly version must be updated to reflect which code version that was used to update the database.

Declaration
public void EnsureContentTypeVersionUpToDate()

Validate(ContentModelValidator)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. The Validate method checks the contenttypemodels guid and its modeltype. If the guid for the contenttypemodel is not assigned or is empty then it passes validation. If two contenttypes has same guid with different modeltype then SynchronizationException be thrown the validation checks on both contenttypemodels in memory and against repository.

Declaration
public virtual void Validate(ContentModelValidator modelValidator)
Parameters
Type Name Description
ContentModelValidator modelValidator
Exceptions
Type Condition
SynchronizationException

If two or more contenttypes has same guid with different modeltype then SynchronizationException be thrown.

Explicit Interface Implementations

IContentTypeModelRegistrator.RegisterTypes(IEnumerable<ContentTypeModel>, Boolean, Boolean)

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

Declaration
void IContentTypeModelRegistrator.RegisterTypes(IEnumerable<ContentTypeModel> typeModels, bool deleteUnusedContentTypes, bool deleteUnusedPropertyDefinitions)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ContentTypeModel> typeModels

List of all content type models that should be registered.

System.Boolean deleteUnusedContentTypes

If set to true any content types that are no longer used are deleted.

System.Boolean deleteUnusedPropertyDefinitions

If set to true any property definitions on that are no longer used are removed from the content type.

Implements

Extension Methods