Class Relation
Represents a Relation between two items
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[DataContract(IsReference = true)]
public class Relation : EntityBase, IRelation, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceRelation(int, int, Guid, Guid, IRelationType)
Constructor for reconstructing the entity from the data source
Declaration
public Relation(int parentId, int childId, Guid parentObjectType, Guid childObjectType, IRelationType relationType)
Parameters
| Type | Name | Description |
|---|---|---|
| int | parentId | |
| int | childId | |
| Guid | parentObjectType | |
| Guid | childObjectType | |
| IRelationType | relationType |
Relation(int, int, IRelationType)
Constructor for constructing the entity to be created
Declaration
public Relation(int parentId, int childId, IRelationType relationType)
Parameters
| Type | Name | Description |
|---|---|---|
| int | parentId | |
| int | childId | |
| IRelationType | relationType |
Properties
View SourceChildId
Gets or sets the Child Id of the Relation (Destination)
Declaration
[DataMember]
public int ChildId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ChildObjectType
Gets or sets the object type of the child entity.
Declaration
[DataMember]
public Guid ChildObjectType { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid |
Comment
Gets or sets a comment for the Relation
Declaration
[DataMember]
public string? Comment { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ParentId
Gets or sets the Parent Id of the Relation (Source)
Declaration
[DataMember]
public int ParentId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ParentObjectType
Gets or sets the object type of the parent entity.
Declaration
[DataMember]
public Guid ParentObjectType { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid |
RelationType
Gets or sets the RelationType for the Relation
Declaration
[DataMember]
public IRelationType RelationType { get; set; }
Property Value
| Type | Description |
|---|---|
| IRelationType |
RelationTypeId
Gets the Id of the RelationType that this Relation is based on.
Declaration
[IgnoreDataMember]
public int RelationTypeId { get; }
Property Value
| Type | Description |
|---|---|
| int |