Class ReadOnlyRelation
A read only relation. Can be used to bulk save witch performs better than the normal save operation, but do not populate Ids back to the model
Inheritance
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public class ReadOnlyRelation
Constructors
View SourceReadOnlyRelation(int, int, int)
Initializes a new instance of the ReadOnlyRelation class for a new relation.
Declaration
public ReadOnlyRelation(int parentId, int childId, int relationTypeId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | parentId | The identifier of the parent entity. |
| int | childId | The identifier of the child entity. |
| int | relationTypeId | The identifier of the relation type. |
ReadOnlyRelation(int, int, int, int, DateTime, string)
Initializes a new instance of the ReadOnlyRelation class with all properties.
Declaration
public ReadOnlyRelation(int id, int parentId, int childId, int relationTypeId, DateTime createDate, string comment)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The identifier of the relation. |
| int | parentId | The identifier of the parent entity. |
| int | childId | The identifier of the child entity. |
| int | relationTypeId | The identifier of the relation type. |
| DateTime | createDate | The date and time when the relation was created. |
| string | comment | An optional comment about the relation. |
Properties
View SourceChildId
Gets the identifier of the child entity.
Declaration
public int ChildId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Comment
Gets the comment associated with the relation.
Declaration
public string Comment { get; }
Property Value
| Type | Description |
|---|---|
| string |
CreateDate
Gets the date and time when the relation was created.
Declaration
public DateTime CreateDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
HasIdentity
Gets a value indicating whether this relation has been persisted and has an identity.
Declaration
public bool HasIdentity { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Id
Gets the identifier of the relation.
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| int |
ParentId
Gets the identifier of the parent entity.
Declaration
public int ParentId { get; }
Property Value
| Type | Description |
|---|---|
| int |
RelationTypeId
Gets the identifier of the relation type.
Declaration
public int RelationTypeId { get; }
Property Value
| Type | Description |
|---|---|
| int |