Class ContentVersionDto
Represents a data transfer object (DTO) that encapsulates information about a specific version of content within Umbraco CMS.
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Persistence.Dtos
Assembly: Umbraco.Infrastructure.dll
Syntax
public class ContentVersionDto
Constructors
View SourceContentVersionDto()
Declaration
public ContentVersionDto()
Fields
View SourcePrimaryKeyColumnName
Declaration
public const string PrimaryKeyColumnName = "id"
Field Value
| Type | Description |
|---|---|
| string |
TableName
Declaration
public const string TableName = "umbracoContentVersion"
Field Value
| Type | Description |
|---|---|
| string |
VersionDateColumnName
Declaration
public const string VersionDateColumnName = "versionDate"
Field Value
| Type | Description |
|---|---|
| string |
Properties
View SourceContentDto
Gets or sets the ContentDto associated with this content version.
Declaration
public ContentDto? ContentDto { get; set; }
Property Value
| Type | Description |
|---|---|
| ContentDto |
Current
Gets or sets a value indicating whether this is the current version of the content.
Declaration
[Index(IndexTypes.NonClustered, Name = "IX_umbracoContentVersion_Current", IncludeColumns = "nodeId")]
public bool Current { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Id
Gets or sets the unique identifier for the content version.
Declaration
[PrimaryKeyColumn]
public int Id { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
NodeId
Gets or sets the unique identifier of the node for this content version.
Declaration
[ForeignKey(typeof(ContentDto))]
[Index(IndexTypes.NonClustered, Name = "IX_umbracoContentVersion_NodeId", ForColumns = "nodeId,current", IncludeColumns = "id,versionDate,text,userId,preventCleanup")]
public int NodeId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
PreventCleanup
Gets or sets a value indicating whether this content version is protected from cleanup operations.
Declaration
[Constraint(Default = "0")]
public bool PreventCleanup { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Text
Gets or sets the textual representation associated with this content version.
Declaration
[NullSetting(NullSetting = NullSettings.Null)]
public string? Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
about current: there is nothing in the DB that guarantees that there will be one, and exactly one, current version per content item. that would require circular FKs that are impossible (well, it is possible to create them, but not to insert). we could use a content.currentVersionId FK that would need to be nullable, or (better?) an additional table linking a content itemt to its current version (nodeId, versionId) - that would guarantee uniqueness BUT it would not guarantee existence - so, really... we are trusting our code to manage 'current' correctly.
UserId
Gets or sets the ID of the user who last modified or updated this content version.
A value of null indicates that no user is associated with the update.
Declaration
[ForeignKey(typeof(UserDto))]
[NullSetting(NullSetting = NullSettings.Null)]
public int? UserId { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Remarks
Returns null if zero. TODO: db rename to 'updateUserId'.
VersionDate
Gets or sets the date and time when the content version was last updated.
Declaration
[Index(IndexTypes.NonClustered, Name = "IX_umbracoContentVersion_VersionDate")]
[Constraint(Default = SystemMethods.CurrentUTCDateTime)]
public DateTime VersionDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Remarks
TODO: db rename to 'updateDate'