View Source
  Class Relation
  
  Represents a Relation between two items
    Inheritance
      System.Object
      
      
      
   
  
  Assembly: Umbraco.Core.dll
  Syntax
  
    [DataContract(IsReference = true)]
public class Relation : EntityBase, IRelation, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
   
  Constructors
  
  
    View Source
  
  Relation(Int32, Int32, 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 | 
    
    
      
        | System.Int32 | parentId |  | 
      
        | System.Int32 | childId |  | 
      
        | Guid | parentObjectType |  | 
      
        | Guid | childObjectType |  | 
      
        | IRelationType | relationType |  | 
    
  
  
    View Source
  
  Relation(Int32, Int32, IRelationType)
  Constructor for constructing the entity to be created
Declaration
  
    public Relation(int parentId, int childId, IRelationType relationType)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int32 | parentId |  | 
      
        | System.Int32 | childId |  | 
      
        | IRelationType | relationType |  | 
    
  
  Properties
  
  
    View Source
  
  ChildId
  Gets or sets the Child Id of the Relation (Destination)
Declaration
  
    [DataMember]
public int ChildId { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Int32 |  | 
    
  
  
    View Source
  
  ChildObjectType
  
  
  Declaration
  
    [DataMember]
public Guid ChildObjectType { get; set; }
   
  Property Value
  
  
    View Source
  
  
  Gets or sets a comment for the Relation
Declaration
  
    [DataMember]
public string Comment { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
    View Source
  
  ParentId
  Gets or sets the Parent Id of the Relation (Source)
Declaration
  
    [DataMember]
public int ParentId { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Int32 |  | 
    
  
  
    View Source
  
  ParentObjectType
  
  
  Declaration
  
    [DataMember]
public Guid ParentObjectType { get; set; }
   
  Property Value
  
  
    View Source
  
  RelationType
  
  
  Declaration
  
    [DataMember]
public IRelationType RelationType { get; set; }
   
  Property Value
  
  
    View Source
  
  RelationTypeId
  Gets the Id of the RelationType that this Relation is based on.
Declaration
  
    [IgnoreDataMember]
public int RelationTypeId { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Int32 |  |