Class DocumentDto
Represents a data transfer object (DTO) for a content document within the Umbraco CMS persistence layer.
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Persistence.Dtos
Assembly: Umbraco.Infrastructure.dll
Syntax
public class DocumentDto
Constructors
View SourceDocumentDto()
Declaration
public DocumentDto()
Fields
View SourcePrimaryKeyColumnName
Declaration
public const string PrimaryKeyColumnName = "nodeId"
Field Value
| Type | Description |
|---|---|
| string |
PublishedColumnName
Declaration
public const string PublishedColumnName = "published"
Field Value
| Type | Description |
|---|---|
| string |
TableName
Declaration
public const string TableName = "umbracoDocument"
Field Value
| Type | Description |
|---|---|
| string |
Properties
View SourceContentDto
Gets or sets the ContentDto instance that contains the content data associated with this document.
Declaration
public ContentDto ContentDto { get; set; }
Property Value
| Type | Description |
|---|---|
| ContentDto |
Remarks
[Column("publishTemplateId")] [NullSetting(NullSetting = NullSettings.Null)] // is documentVersionDto.TemplateId for the published version public int? PublishTemplateId { get; set; }
DocumentVersionDto
Gets or sets the document version data transfer object (DTO) that is referenced in a one-to-one relationship with this document. Although a document can have multiple versions, this property represents the specific version associated with this instance.
Declaration
public DocumentVersionDto DocumentVersionDto { get; set; }
Property Value
| Type | Description |
|---|---|
| DocumentVersionDto |
Remarks
although a content has many content versions, they can only be loaded one by one (as several content), so this here is a OneToOne reference
Edited
Gets or sets a value indicating whether this document has been modified since it was last published or saved.
Declaration
public bool Edited { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
NodeId
Gets or sets the unique identifier for the node associated with this document.
Declaration
[PrimaryKeyColumn(AutoIncrement = false)]
[ForeignKey(typeof(ContentDto))]
public int NodeId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Published
Gets or sets a value indicating whether the document is published.
Declaration
[Index(IndexTypes.NonClustered, Name = "IX_umbracoDocument_Published")]
public bool Published { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
PublishedVersionDto
Gets or sets the DTO containing information about the published version of the document.
Declaration
public DocumentVersionDto? PublishedVersionDto { get; set; }
Property Value
| Type | Description |
|---|---|
| DocumentVersionDto |
Remarks
same