Class PropertyDefinitionSynchronizer
Handles synchronization of PropertyDefinition from model to database.
Inheritance
Implements
Namespace: EPiServer.DataAbstraction.RuntimeModel.Internal
Assembly: EPiServer.dll
Version: 12.0.3Syntax
[ServiceConfiguration]
[ServiceConfiguration]
public class PropertyDefinitionSynchronizer : Object, IPropertyDefinitionTypeResolver
Constructors
PropertyDefinitionSynchronizer()
Initializes a new instance of the PropertyDefinitionSynchronizer class.
Declaration
public PropertyDefinitionSynchronizer()
Remarks
This constructor is available to make the class mockable in tests.
PropertyDefinitionSynchronizer(IPropertyDefinitionRepository, IPropertyDefinitionTypeRepository, ITabDefinitionRepository, IContentModelUsage, IBackingTypeResolver, MigrationStepRepository)
Initializes a new instance of the PropertyDefinitionSynchronizer class.
Declaration
public PropertyDefinitionSynchronizer(IPropertyDefinitionRepository propertyDefinitionRepository, IPropertyDefinitionTypeRepository propertyDefinitionTypeRepository, ITabDefinitionRepository tabDefinitionRepository, IContentModelUsage contentModelUsage, IBackingTypeResolver backingTypeResolver, MigrationStepRepository migrationStepRepository)
Parameters
Type | Name | Description |
---|---|---|
IPropertyDefinitionRepository | propertyDefinitionRepository | The property definition repository. |
IPropertyDefinitionTypeRepository | propertyDefinitionTypeRepository | The property definition type repository. |
ITabDefinitionRepository | tabDefinitionRepository | The tab definition repository. |
IContentModelUsage | contentModelUsage | The page model usage. |
IBackingTypeResolver | backingTypeResolver | Resolves the base type from a specified type. |
MigrationStepRepository | migrationStepRepository | The migration step repository. |
Methods
CreatePropertyDefinition(PropertyDefinitionModel, Int32)
Creates a page definition from a model.
Declaration
public virtual void CreatePropertyDefinition(PropertyDefinitionModel model, int contentTypeID)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinitionModel | model | The model. |
System.Int32 | contentTypeID | The page type ID. |
Delete(PropertyDefinition)
Deletes the specified page definition.
Declaration
public virtual void Delete(PropertyDefinition propertyDefinition)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinition | propertyDefinition | The property definition. |
ExistsPropertyDefinitionWithContentType(Guid)
Determines whether there is any property definition of the specified content type.
Declaration
public bool ExistsPropertyDefinitionWithContentType(Guid contentTypeID)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | contentTypeID | The content type ID. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
An example would be if there is a page type that has a property definition of a block with the specified id (contentTypeID)
GetPagesWithPropertyDefinition(PropertyDefinition)
Gets a list of all existing contents that uses the content definition.
Declaration
public virtual IList<ContentUsage> GetPagesWithPropertyDefinition(PropertyDefinition propertyDefinition)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinition | propertyDefinition | The property definition. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<ContentUsage> | A list of all content that uses the content definition. |
IsPropertyDefinitionUsed(PropertyDefinition)
Checks if there is data stored for a property definition.
Declaration
public virtual bool IsPropertyDefinitionUsed(PropertyDefinition propertyDefinition)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinition | propertyDefinition | The property definition. |
Returns
Type | Description |
---|---|
System.Boolean | true if there is data stored for definition otherwise false. |
ResolveType(PropertyDefinitionModel)
Resolves the property definition type for the specified model.
Declaration
public virtual PropertyDefinitionType ResolveType(PropertyDefinitionModel model)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinitionModel | model | The model to resolve. |
Returns
Type | Description |
---|---|
PropertyDefinitionType |
UpdatePropertyDefinition(PropertyDefinitionModel)
Updates a property definition.
Declaration
public virtual void UpdatePropertyDefinition(PropertyDefinitionModel model)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinitionModel | model | The property definition model to update to. |