Class ContentVersionMeta
Represents metadata about a content version.
Inheritance
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public class ContentVersionMeta
Remarks
This class contains information about a specific version of content, including the user who created it, the date, and whether it's the current published or draft version.
Constructors
View SourceContentVersionMeta()
Initializes a new instance of the ContentVersionMeta class.
Declaration
public ContentVersionMeta()
ContentVersionMeta(int, int, int, int, DateTime, bool, bool, bool, string)
Initializes a new instance of the ContentVersionMeta class with the specified values.
Declaration
public ContentVersionMeta(int versionId, int contentId, int contentTypeId, int userId, DateTime versionDate, bool currentPublishedVersion, bool currentDraftVersion, bool preventCleanup, string username)
Parameters
| Type | Name | Description |
|---|---|---|
| int | versionId | The version identifier. |
| int | contentId | The content identifier. |
| int | contentTypeId | The content type identifier. |
| int | userId | The identifier of the user who created this version. |
| DateTime | versionDate | The date and time when this version was created. |
| bool | currentPublishedVersion | A value indicating whether this is the current published version. |
| bool | currentDraftVersion | A value indicating whether this is the current draft version. |
| bool | preventCleanup | A value indicating whether this version should be prevented from cleanup. |
| string | username | The username of the user who created this version. |
Properties
View SourceContentId
Gets the content identifier.
Declaration
public int ContentId { get; }
Property Value
| Type | Description |
|---|---|
| int |
ContentTypeId
Gets the content type identifier.
Declaration
public int ContentTypeId { get; }
Property Value
| Type | Description |
|---|---|
| int |
CurrentDraftVersion
Gets a value indicating whether this is the current draft version.
Declaration
public bool CurrentDraftVersion { get; }
Property Value
| Type | Description |
|---|---|
| bool |
CurrentPublishedVersion
Gets a value indicating whether this is the current published version.
Declaration
public bool CurrentPublishedVersion { get; }
Property Value
| Type | Description |
|---|---|
| bool |
PreventCleanup
Gets a value indicating whether this version should be prevented from automatic cleanup.
Declaration
public bool PreventCleanup { get; }
Property Value
| Type | Description |
|---|---|
| bool |
UserId
Gets the identifier of the user who created this version.
Declaration
public int UserId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Username
Gets the username of the user who created this version.
Declaration
public string? Username { get; }
Property Value
| Type | Description |
|---|---|
| string |
VersionDate
Gets the date and time when this version was created.
Declaration
public DateTime VersionDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
VersionId
Gets the version identifier.
Declaration
public int VersionId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceEnsureUtc()
Ensures the VersionDate is in UTC format.
Declaration
public void EnsureUtc()
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |