Search Results for

    Show / Hide Table of Contents
    View Source

    Class MemberPropertyModel

    A simple representation of an Umbraco member property

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    public class MemberPropertyModel

    Constructors

    View Source

    MemberPropertyModel()

    Declaration
    public MemberPropertyModel()

    Properties

    View Source

    Alias

    Gets or sets the alias of the property.

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

    Name

    Gets or sets the display name of the property.

    Declaration
    public string? Name { get; set; }
    Property Value
    Type Description
    string
    View Source

    Value

    Gets or sets the value of the property as a string.

    Declaration
    [DataType(DataType.Text)]
    public string? Value { get; set; }
    Property Value
    Type Description
    string
    Remarks

    This has to be a string currently, if it is an object it will bind as an array which we don't want. If we want to have this as an 'object' with a true type on it, we have to create a custom model binder for an UmbracoProperty and then bind with the correct type based on the property type for this alias. This would be a bit long winded and perhaps unnecessary. The reason is because it is always posted as a string anyways and when we set this value on the property object that gets sent to the database we do a TryConvertTo to the real type anyways.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX