Interface IDocumentVersionRepository
Represents a repository for document version operations.
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface IDocumentVersionRepository : IRepository
Methods
View SourceDeleteVersions(IEnumerable<int>)
Deletes multiple content versions by ID.
Declaration
void DeleteVersions(IEnumerable<int> versionIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<int> | versionIds |
Get(int)
Gets the content version metadata for a specific version.
Declaration
ContentVersionMeta? Get(int versionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | versionId |
Returns
| Type | Description |
|---|---|
| ContentVersionMeta |
GetCleanupPolicies()
Gets cleanup policy override settings per content type.
Declaration
IReadOnlyCollection<ContentVersionCleanupPolicySettings> GetCleanupPolicies()
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<ContentVersionCleanupPolicySettings> |
GetDocumentVersionsEligibleForCleanup()
Gets a list of all historic content versions.
Declaration
[Obsolete("Use the overload accepting olderThan and maxCount. Scheduled for removal in Umbraco 19.")]
IReadOnlyCollection<ContentVersionMeta> GetDocumentVersionsEligibleForCleanup()
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<ContentVersionMeta> |
GetDocumentVersionsEligibleForCleanup(DateTime, int?)
Gets document versions eligible for cleanup, filtered to those older than the specified date and limited to a maximum number of results, ordered oldest first.
Declaration
IReadOnlyCollection<ContentVersionMeta> GetDocumentVersionsEligibleForCleanup(DateTime olderThan, int? maxCount)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | olderThan | Only versions with a date earlier than this are returned. |
| int? | maxCount | The maximum number of versions to return, or |
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<ContentVersionMeta> |
GetPagedItemsByContentId(int, long, int, out long, int?)
Gets paginated content versions for given content id paginated.
Declaration
IEnumerable<ContentVersionMeta> GetPagedItemsByContentId(int contentId, long pageIndex, int pageSize, out long totalRecords, int? languageId = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contentId | |
| long | pageIndex | |
| int | pageSize | |
| long | totalRecords | |
| int? | languageId |
Returns
| Type | Description |
|---|---|
| IEnumerable<ContentVersionMeta> |
SetPreventCleanup(int, bool)
Updates the prevent cleanup flag on a content version.
Declaration
void SetPreventCleanup(int versionId, bool preventCleanup)
Parameters
| Type | Name | Description |
|---|---|---|
| int | versionId | |
| bool | preventCleanup |