Class DefaultPropertyDefinitionRepository
Default implementation of PropertyDefinitionRepository.
Inherited Members
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class DefaultPropertyDefinitionRepository : PropertyDefinitionRepository, IPropertyDefinitionRepository, ICachedRepository
Constructors
DefaultPropertyDefinitionRepository(ContentTypeModelRepository, ITabDefinitionRepository, ServiceAccessor<PropertyDefinitionDB>, ModelMerger)
Initializes a new instance of the DefaultPropertyDefinitionRepository class.
Declaration
public DefaultPropertyDefinitionRepository(ContentTypeModelRepository modelRepository, ITabDefinitionRepository tabDefinitionRepository, ServiceAccessor<PropertyDefinitionDB> pageDefinitionDataAccessor, ModelMerger modelMerger)
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. |
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 |
| System.Boolean | onlyPublished | if set to |
| System.Boolean | isDynamic | if set to |
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 |
|
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 |
| System.Boolean | onlyPublished | if set to |
| System.Boolean | isDynamic | if set to |
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 |
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 |
|