Class ContentTypeSynchronizer
Handles synchronization between ContentType and ContentTypeModel.
Inheritance
Inherited Members
Namespace: EPiServer.DataAbstraction.RuntimeModel
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class ContentTypeSynchronizer
Constructors
ContentTypeSynchronizer()
Initializes a new instance of the ContentTypeSynchronizer class.
Declaration
public ContentTypeSynchronizer()
Remarks
This constructor is available to make the class mockable in tests.
ContentTypeSynchronizer(PropertyDefinitionSynchronizer, IContentTypeRepository, IContentModelUsage, MigrationStepRepository, IEnumerable<ContentScannerExtension>)
Initializes a new instance of the ContentTypeSynchronizer class.
Declaration
public ContentTypeSynchronizer(PropertyDefinitionSynchronizer propertyDefinitionSynchronizer, IContentTypeRepository contentTypeRepository, IContentModelUsage contentModelUsage, MigrationStepRepository migrationStepRepository, IEnumerable<ContentScannerExtension> registerExtensions)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinitionSynchronizer | propertyDefinitionSynchronizer | The property definition synchronizer. |
IContentTypeRepository | contentTypeRepository | The content type repository. |
IContentModelUsage | contentModelUsage | The content model usage. |
MigrationStepRepository | migrationStepRepository | The migration step repository. |
System.Collections.Generic.IEnumerable<ContentScannerExtension> | registerExtensions | The register extensions. |
Properties
ContentTypeRepository
Gets the content type repository.
Declaration
protected IContentTypeRepository ContentTypeRepository { get; }
Property Value
Type | Description |
---|---|
IContentTypeRepository | The content type repository. |
Methods
AssignValuesFromModel(ContentType, ContentTypeModel)
Assigns values from a model.
Declaration
protected virtual void AssignValuesFromModel(ContentType contentType, ContentTypeModel contentModel)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type content type, which will be populatetd with values. |
ContentTypeModel | contentModel | The content model to get values from. |
CreateType(ContentTypeModel)
Creates a new ContentType from a model.
Declaration
public virtual ContentType CreateType(ContentTypeModel contentModel)
Parameters
Type | Name | Description |
---|---|---|
ContentTypeModel | contentModel | The content model. |
Returns
Type | Description |
---|---|
ContentType |
Delete(ContentType)
Deletes the specified content type.
Declaration
public virtual void Delete(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |
GetType(ContentTypeModel)
Gets a ContentType that corresponds to a model.
Declaration
public virtual ContentType GetType(ContentTypeModel contentTypeModel)
Parameters
Type | Name | Description |
---|---|---|
ContentTypeModel | contentTypeModel | The content type model. |
Returns
Type | Description |
---|---|
ContentType |
ListUnusedTypes(IEnumerable<ContentTypeModel>)
Lists the ContentType generated from models that are registered in database but does not have a corresponding model anymore.
Declaration
public virtual IEnumerable<ContentType> ListUnusedTypes(IEnumerable<ContentTypeModel> typeModels)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ContentTypeModel> | typeModels | The content type models. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ContentType> |
UpdateType(ContentTypeModel)
Updates a ContentType from the model.
Declaration
public virtual void UpdateType(ContentTypeModel model)
Parameters
Type | Name | Description |
---|---|---|
ContentTypeModel | model | The content type model. |