Class PropertyDefinitionSynchronizer
Handles synchronization of Property
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 Property
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 Property
Declaration
public PropertyDefinitionSynchronizer(IPropertyDefinitionRepository propertyDefinitionRepository, IPropertyDefinitionTypeRepository propertyDefinitionTypeRepository, ITabDefinitionRepository tabDefinitionRepository, IContentModelUsage contentModelUsage, IBackingTypeResolver backingTypeResolver, MigrationStepRepository migrationStepRepository)
Parameters
Type | Name | Description |
---|---|---|
IProperty |
propertyDefinitionRepository | The property definition repository. |
IProperty |
propertyDefinitionTypeRepository | The property definition type repository. |
ITab |
tabDefinitionRepository | The tab definition repository. |
IContent |
contentModelUsage | The page model usage. |
IBacking |
backingTypeResolver | Resolves the base type from a specified type. |
Migration |
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 |
---|---|---|
Property |
model | The model. |
System. |
contentTypeID | The page type ID. |
Delete(PropertyDefinition)
Deletes the specified page definition.
Declaration
public virtual void Delete(PropertyDefinition propertyDefinition)
Parameters
Type | Name | Description |
---|---|---|
Property |
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. |
contentTypeID | The content type ID. |
Returns
Type | Description |
---|---|
System. |
|
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 |
---|---|---|
Property |
propertyDefinition | The property definition. |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
Property |
propertyDefinition | The property definition. |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
Property |
model | The model to resolve. |
Returns
Type | Description |
---|---|
Property |
UpdatePropertyDefinition(PropertyDefinitionModel)
Updates a property definition.
Declaration
public virtual void UpdatePropertyDefinition(PropertyDefinitionModel model)
Parameters
Type | Name | Description |
---|---|---|
Property |
model | The property definition model to update to. |