November Happy Hour will be moved to Thursday December 5th.

Class DefaultPropertyDefinitionRepository

Inheritance
System.Object
DefaultPropertyDefinitionRepository
Namespace: EPiServer.DataAbstraction.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
public class DefaultPropertyDefinitionRepository : PropertyDefinitionRepository, IPropertyDefinitionRepository, ICachedRepository

Constructors

DefaultPropertyDefinitionRepository(ContentTypeModelRepository, ITabDefinitionRepository, ServiceAccessor<PropertyDefinitionDB>, ModelMerger, ISynchronizedObjectInstanceCache)

Initializes a new instance of the DefaultPropertyDefinitionRepository class.

Declaration
public DefaultPropertyDefinitionRepository(ContentTypeModelRepository modelRepository, ITabDefinitionRepository tabDefinitionRepository, ServiceAccessor<PropertyDefinitionDB> pageDefinitionDataAccessor, ModelMerger modelMerger, ISynchronizedObjectInstanceCache cache)
Parameters
Type Name Description
ContentTypeModelRepository modelRepository

The model repository.

ITabDefinitionRepository tabDefinitionRepository

The tab definition repository.

ServiceAccessor<PropertyDefinitionDB> pageDefinitionDataAccessor

The page definition data accessor.

ModelMerger modelMerger

The model merger.

ISynchronizedObjectInstanceCache cache

The cache

Methods

CheckUsage(Int32, Boolean, Boolean, Boolean)

Retrieves information about the usage of the PropertyDefinition.

Declaration
public override bool CheckUsage(int propertyDefinitionID, bool onlyLanguageSpecific, bool onlyPublished, bool isDynamic)
Parameters
Type Name Description
System.Int32 propertyDefinitionID

The property definition ID.

System.Boolean onlyLanguageSpecific

if set to true only language specific usage is retrieved.

System.Boolean onlyPublished

if set to true only published versions will be checked.

System.Boolean isDynamic

if set to true only dynamic properties will be considered.

Returns
Type Description
System.Boolean

List of ContentUsage which contains information on what content uses the specified PropertyDefinition.

Overrides

ClearCache()

Clears all the cached data from the repository.

Declaration
public void ClearCache()

ClearCache(PropertyDefinition)

Clears the cache manager for the specified property definition.

Declaration
public static void ClearCache(PropertyDefinition propertyDefinition)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The property definition which cache will be cleared.

Delete(PropertyDefinition)

Deletes a PropertyDefinition from the data repository.

Declaration
public override void Delete(PropertyDefinition propertyDefinition)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The PropertyDefinition to delete.

Overrides

ExistsPropertyDefinitionWithContentType(Guid)

Determines whether there is any property definition of the specified content type.

Declaration
public override 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.

Overrides
Remarks

An example would be if there is a content type that has a property definition of a block with the specified id (contentTypeID)

GetUsage(Int32, Boolean, Boolean, Boolean)

Retrieves information about the usage of the PropertyDefinition.

Declaration
public override IEnumerable<ContentUsage> GetUsage(int propertyDefinitionID, bool onlyNoneMasterLanguage, bool onlyPublished, bool isDynamic)
Parameters
Type Name Description
System.Int32 propertyDefinitionID

The property definition ID.

System.Boolean onlyNoneMasterLanguage

if set to true only none master langauge are taken into account.

System.Boolean onlyPublished

if set to true only published versions will be checked.

System.Boolean isDynamic

if set to true only dynamic properties will be considered.

Returns
Type Description
System.Collections.Generic.IEnumerable<ContentUsage>

List of ContentUsage which contains information on what pages uses the specified PropertyDefinition.

Overrides

List(Int32)

Lists all PropertyDefinitions in the data repository for a specific content type id.

Declaration
public override IEnumerable<PropertyDefinition> List(int contentTypeID)
Parameters
Type Name Description
System.Int32 contentTypeID

The content type id.

Returns
Type Description
System.Collections.Generic.IEnumerable<PropertyDefinition>

Enumeration of PropertyDefinitions on specified content type.

Overrides

Load(Int32)

Load a definition based on its identifier.

Declaration
public override PropertyDefinition Load(int propertyDefinitionID)
Parameters
Type Name Description
System.Int32 propertyDefinitionID

The property definition identifier.

Returns
Type Description
PropertyDefinition

The definition if found or null.

Overrides

Save(PropertyDefinition, Boolean)

Saves the specified PropertyDefinition to the data repository.

Declaration
public override void Save(PropertyDefinition propertyDefinition, bool forceCacheClear)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The property definition to save.

System.Boolean forceCacheClear

Flag to determine if cache should be cleared regardless if anything is changed.

Overrides
Exceptions
Type Condition
System.NotSupportedException

propertyDefinition is marked as read only.

Implements

Extension Methods