Interface IDocumentRepository
Represents a repository for IContent document entities.
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface IDocumentRepository : IPublishableContentRepository<IContent>, IContentRepository<int, IContent>, IReadWriteQueryRepository<int, IContent>, IReadRepository<int, IContent>, IWriteRepository<IContent>, IQueryRepository<IContent>, IReadRepository<Guid, IContent>, IRepository
Methods
View SourceAddOrUpdatePermissions(ContentPermissionSet)
Used to add/update a permission for a content item
Declaration
void AddOrUpdatePermissions(ContentPermissionSet permission)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentPermissionSet | permission |
AssignEntityPermission(IContent, string, IEnumerable<int>)
Assigns a single permission to the current content item for the specified user group ids
Declaration
void AssignEntityPermission(IContent entity, string permission, IEnumerable<int> groupIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | entity | |
| string | permission | |
| IEnumerable<int> | groupIds |
GetPage(IQuery<IContent>?, long, int, out long, string[]?, IQuery<IContent>?, Ordering?, bool)
Gets paged documents.
Declaration
IEnumerable<IContent> GetPage(IQuery<IContent>? query, long pageIndex, int pageSize, out long totalRecords, string[]? propertyAliases, IQuery<IContent>? filter, Ordering? ordering, bool loadTemplates)
Parameters
| Type | Name | Description |
|---|---|---|
| IQuery<IContent> | query | The base query for documents. |
| long | pageIndex | The page index (zero-based). |
| int | pageSize | The number of items per page. |
| long | totalRecords | Output parameter with total record count. |
| string[] | propertyAliases | Optional array of property aliases to load. If null, all properties are loaded. If empty array, no custom properties are loaded (only system properties). |
| IQuery<IContent> | filter | Optional filter query. |
| Ordering | ordering | The ordering specification. |
| bool | loadTemplates | Whether to load templates. Set to false for performance optimization when templates are not needed (e.g., collection views). Default is true. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IContent> | A collection of documents for the specified page. |
Remarks
Here, filter can be null but ordering cannot.
GetPermissionsForEntity(int)
Gets the explicit list of permissions for the content item
Declaration
EntityPermissionCollection GetPermissionsForEntity(int entityId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | entityId |
Returns
| Type | Description |
|---|---|
| EntityPermissionCollection |
RecycleBinSmells()
Returns true if there is any content in the recycle bin
Declaration
bool RecycleBinSmells()
Returns
| Type | Description |
|---|---|
| bool |
ReplaceContentPermissions(EntityPermissionSet)
Clears the publishing schedule for all entries having a date before (lower than, or equal to) a specified date.
Declaration
void ReplaceContentPermissions(EntityPermissionSet permissionSet)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityPermissionSet | permissionSet |