Try our conversational search powered by Generative AI!

Class PropertyDefinitionSynchronizer

Handles synchronization of PropertyDefinition from model to database.

Inheritance
System.Object
PropertyDefinitionSynchronizer
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
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class PropertyDefinitionSynchronizer

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, BackingTypeResolver, MigrationStepRepository)

Initializes a new instance of the PropertyDefinitionSynchronizer class.

Declaration
public PropertyDefinitionSynchronizer(IPropertyDefinitionRepository propertyDefinitionRepository, IPropertyDefinitionTypeRepository propertyDefinitionTypeRepository, ITabDefinitionRepository tabDefinitionRepository, IContentModelUsage pageModelUsage, BackingTypeResolver 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 pageModelUsage

The page model usage.

BackingTypeResolver 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

true if there is a property definition of the specified type; otherwise, false.

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 defintion 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.

Extension Methods