Search Results for

    Show / Hide Table of Contents
    View Source

    Class Property

    Represents a property.

    Inheritance
    object
    BeingDirtyBase
    EntityBase
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [Serializable]
    [DataContract(IsReference = true)]
    public class Property : EntityBase, IProperty, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty

    Constructors

    View Source

    Property(int, IPropertyType)

    Initializes a new instance of the Property class.

    Declaration
    public Property(int id, IPropertyType propertyType)
    Parameters
    Type Name Description
    int id
    IPropertyType propertyType
    View Source

    Property(IPropertyType)

    Initializes a new instance of the Property class.

    Declaration
    public Property(IPropertyType propertyType)
    Parameters
    Type Name Description
    IPropertyType propertyType

    Properties

    View Source

    Alias

    Returns the Alias of the PropertyType, which this Property is based on

    Declaration
    [DataMember]
    public string Alias { get; }
    Property Value
    Type Description
    string
    View Source

    PropertyType

    Returns the PropertyType, which this Property is based on

    Declaration
    [IgnoreDataMember]
    public IPropertyType PropertyType { get; }
    Property Value
    Type Description
    IPropertyType
    View Source

    PropertyTypeId

    Returns the Id of the PropertyType, which this Property is based on

    Declaration
    [IgnoreDataMember]
    public int PropertyTypeId { get; }
    Property Value
    Type Description
    int
    View Source

    ValueStorageType

    Returns the DatabaseType that the underlaying DataType is using to store its values

    Declaration
    [IgnoreDataMember]
    public ValueStorageType ValueStorageType { get; }
    Property Value
    Type Description
    ValueStorageType
    Remarks

    Only used internally when saving the property value.

    View Source

    Values

    Gets the list of values.

    Declaration
    [DataMember]
    public IReadOnlyCollection<IPropertyValue> Values { get; set; }
    Property Value
    Type Description
    IReadOnlyCollection<IPropertyValue>

    Methods

    View Source

    ConvertAssignedValue(object?)

    Declaration
    public object? ConvertAssignedValue(object? value)
    Parameters
    Type Name Description
    object value
    Returns
    Type Description
    object
    View Source

    CreateWithValues(int, IPropertyType, params InitialPropertyValue[])

    Creates a new Property instance for existing IProperty

    Declaration
    public static Property CreateWithValues(int id, IPropertyType propertyType, params Property.InitialPropertyValue[] values)
    Parameters
    Type Name Description
    int id
    IPropertyType propertyType
    InitialPropertyValue[] values

    Generally will contain a published and an unpublished property values

    Returns
    Type Description
    Property
    View Source

    GetValue(string?, string?, bool)

    Gets the value.

    Declaration
    public object? GetValue(string? culture = null, string? segment = null, bool published = false)
    Parameters
    Type Name Description
    string culture
    string segment
    bool published
    Returns
    Type Description
    object
    View Source

    PerformDeepClone(object)

    Used by inheritors to modify the DeepCloning logic

    Declaration
    protected override void PerformDeepClone(object clone)
    Parameters
    Type Name Description
    object clone
    View Source

    PublishPartialValues(IDataEditor, string?)

    Declaration
    public void PublishPartialValues(IDataEditor dataEditor, string? culture)
    Parameters
    Type Name Description
    IDataEditor dataEditor
    string culture
    View Source

    PublishValues(string?, string?)

    Declaration
    public void PublishValues(string? culture = "*", string? segment = "*")
    Parameters
    Type Name Description
    string culture
    string segment
    View Source

    SetValue(object?, string?, string?)

    Sets a value.

    Declaration
    public bool SetValue(object? value, string? culture = null, string? segment = null)
    Parameters
    Type Name Description
    object value
    string culture
    string segment
    Returns
    Type Description
    bool

    true if the value was set (updated), false otherwise.

    Remarks

    A false return value does not indicate failure, but rather that the property value was not changed (i.e. the value passed in was equal to the current property value).

    View Source

    UnpublishValues(string?, string?)

    Declaration
    public void UnpublishValues(string? culture = "*", string? segment = "*")
    Parameters
    Type Name Description
    string culture
    string segment
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX