Search Results for

    Show / Hide Table of Contents
    View Source

    Class RelationType

    Represents a RelationType

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

    Constructors

    View Source

    RelationType(string, string)

    Initializes a new instance of the RelationType class with alias and name.

    Declaration
    public RelationType(string alias, string name)
    Parameters
    Type Name Description
    string alias

    The alias of the relation type.

    string name

    The name of the relation type.

    View Source

    RelationType(string?, string?, bool, Guid?, Guid?, bool, Guid?)

    Initializes a new instance of the RelationType class with full configuration.

    Declaration
    public RelationType(string? name, string? alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType, bool isDependency, Guid? key = null)
    Parameters
    Type Name Description
    string name

    The name of the relation type.

    string alias

    The alias of the relation type.

    bool isBidrectional

    A value indicating whether the relation is bidirectional.

    Guid? parentObjectType

    The object type GUID of the parent.

    Guid? childObjectType

    The object type GUID of the child.

    bool isDependency

    A value indicating whether this relation represents a dependency.

    Guid? key

    The optional unique key for the relation type.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when name or alias is null.

    ArgumentException

    Thrown when name or alias is empty or whitespace.

    Properties

    View Source

    Alias

    Gets or sets the Alias of the RelationType

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

    ChildObjectType

    Gets or sets the Childs object type id

    Declaration
    [DataMember]
    public Guid? ChildObjectType { get; set; }
    Property Value
    Type Description
    Guid?
    Remarks

    Corresponds to the NodeObjectType in the umbracoNode table

    View Source

    IsBidirectional

    Gets or sets a boolean indicating whether the RelationType is Bidirectional (true) or Parent to Child (false)

    Declaration
    [DataMember]
    public bool IsBidirectional { get; set; }
    Property Value
    Type Description
    bool
    View Source

    IsDependency

    Gets or sets a value indicating whether the relation represents a dependency.

    Declaration
    public bool IsDependency { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    When true, the child entity depends on the parent entity.

    View Source

    Name

    Gets or sets the Name of the RelationType

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

    ParentObjectType

    Gets or sets the Parents object type id

    Declaration
    [DataMember]
    public Guid? ParentObjectType { get; set; }
    Property Value
    Type Description
    Guid?
    Remarks

    Corresponds to the NodeObjectType in the umbracoNode table

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