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

Class DynamicProperty

Read and edit dynamic properties.

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

EPiServer.DataAbstraction.DynamicProperty is a non-cached API for administrative purposes and should not be used on normal templates that are not for administrative purposes. Using this API on your templates will significally impact performance. The recommendation is always to read dynamic properties on PageData objects returned from the global instance of the DataFactory class, EPiServer.DataFactory.Instance.

Examples

Example that changes the value of dynamic property "MetaKeywords" on the current page.

Examples that outputs some debug information for the current page

Constructors

DynamicProperty()

Create a new dynamic property based on a PropertyData object.

Declaration
public DynamicProperty()

DynamicProperty(PageReference, PageReference, PropertyData)

Create a new dynamic property based on tree information

Declaration
public DynamicProperty(PageReference pageLink, PageReference parentLink, PropertyData propertyValue)
Parameters
Type Name Description
PageReference pageLink

The page where the property is defined.

PageReference parentLink

The closest parent that contains dynamic property definitions.

PropertyData propertyValue

The actual value of the dynamic property.

DynamicProperty(PageReference, PropertyData, DynamicPropertyStatus, PageReference, String)

Create a new dynamic property based on a page and inheritance information

Declaration
public DynamicProperty(PageReference pageLink, PropertyData propertyValue, DynamicPropertyStatus status, PageReference inheritedPageLink, string inheritedValue)
Parameters
Type Name Description
PageReference pageLink

The page where the property is defined.

PropertyData propertyValue

The actual value of the dynamic property.

DynamicPropertyStatus status

Information about where this property is set

PageReference inheritedPageLink

The page from where the inherited value origins.

System.String inheritedValue

The textual presentation of the inherited value

DynamicProperty(PageReference, PropertyData, DynamicPropertyStatus, PageReference, String, String)

Create a new dynamic property based on a page and inheritance information

Declaration
public DynamicProperty(PageReference pageLink, PropertyData propertyValue, DynamicPropertyStatus status, PageReference inheritedPageLink, string inheritedValue, string languageBranch)
Parameters
Type Name Description
PageReference pageLink

The page where the property is defined.

PropertyData propertyValue

The actual value of the dynamic property.

DynamicPropertyStatus status

Information about where this property is set

PageReference inheritedPageLink

The page from where the inherited value origins.

System.String inheritedValue

The textual presentation of the inherited value

System.String languageBranch

The specific language branch if the property is language specific

Properties

The page where the interited value originates

Declaration
public PageReference InheritedPageLink { get; }
Property Value
Type Description
PageReference

InheritedValue

The inherited value of the dynamic property, primaraly user for GUI display

Declaration
public string InheritedValue { get; }
Property Value
Type Description
System.String

LanguageBranch

Gets or sets the specific language branch if the property is language specific.

Declaration
public string LanguageBranch { get; set; }
Property Value
Type Description
System.String

Override

If value should override new definitions of this property further down in the tree structure.

Declaration
public bool Override { get; set; }
Property Value
Type Description
System.Boolean

The page where the dynamic property is defined.

Declaration
public PageReference PageLink { get; set; }
Property Value
Type Description
PageReference

The closest parent that contains dynamic property definitions.

Declaration
public PageReference ParentLink { get; set; }
Property Value
Type Description
PageReference

PropertyValue

The actual value of the dynamic property.

Declaration
public PropertyData PropertyValue { get; }
Property Value
Type Description
PropertyData

RawPropertyValue

The value of the dynamic property in raw format, only used for serialization.

Declaration
public RawProperty RawPropertyValue { get; set; }
Property Value
Type Description
RawProperty

Status

Status of property as listed for a specific page

Declaration
public DynamicPropertyStatus Status { get; }
Property Value
Type Description
DynamicPropertyStatus

Methods

ListForPage(PageReference)

List all dynamic properties that can be set for a specific page

Declaration
public static DynamicPropertyCollection ListForPage(PageReference pageLink)
Parameters
Type Name Description
PageReference pageLink

The page to read dynamic properties from

Returns
Type Description
DynamicPropertyCollection

A collection of dynamic properties

Load(PageReference, String)

Load a dynamic property by name and page

Declaration
public static DynamicProperty Load(PageReference pageLink, string propertyName)
Parameters
Type Name Description
PageReference pageLink

The page to read dynamic properties from

System.String propertyName

The property name

Returns
Type Description
DynamicProperty

Save()

Save changes to a dynamic property

Declaration
public void Save()

SaveCollection(PageReference, DynamicPropertyCollection)

Save a collection of dynamic properties in one batch

Declaration
public static void SaveCollection(PageReference pageLink, DynamicPropertyCollection props)
Parameters
Type Name Description
PageReference pageLink

The page to save dynamic properties for

DynamicPropertyCollection props

The collection of dynamic properties to save

TranslateDisplayName()

Translates the name of the dynamic property.

Declaration
public virtual string TranslateDisplayName()
Returns
Type Description
System.String

The translated name of the dynamic property.

Remarks

This method is needed as we add the language branch to the property name to get unique keys in the PropertyDataCollection.

Extension Methods