Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentVersionDto

    Represents a data transfer object (DTO) that encapsulates information about a specific version of content within Umbraco CMS.

    Inheritance
    object
    Namespace: Umbraco.Cms.Infrastructure.Persistence.Dtos
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class ContentVersionDto

    Constructors

    View Source

    ContentVersionDto()

    Declaration
    public ContentVersionDto()

    Fields

    View Source

    PrimaryKeyColumnName

    Declaration
    public const string PrimaryKeyColumnName = "id"
    Field Value
    Type Description
    string
    View Source

    TableName

    Declaration
    public const string TableName = "umbracoContentVersion"
    Field Value
    Type Description
    string
    View Source

    VersionDateColumnName

    Declaration
    public const string VersionDateColumnName = "versionDate"
    Field Value
    Type Description
    string

    Properties

    View Source

    ContentDto

    Gets or sets the ContentDto associated with this content version.

    Declaration
    public ContentDto? ContentDto { get; set; }
    Property Value
    Type Description
    ContentDto
    View Source

    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
    View Source

    Id

    Gets or sets the unique identifier for the content version.

    Declaration
    [PrimaryKeyColumn]
    public int Id { get; set; }
    Property Value
    Type Description
    int
    View Source

    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
    View Source

    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
    View Source

    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.

    View Source

    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'.

    View Source

    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'

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX