View Source
Interface IContentRepository<TId, TEntity>
Defines the base implementation of a repository for content items.
Assembly: Umbraco.Core.dll
Syntax
public interface IContentRepository<in TId, TEntity> : IReadWriteQueryRepository<TId, TEntity>, IReadRepository<TId, TEntity>, IWriteRepository<TEntity>, IQueryRepository<TEntity>, IRepository where TEntity : IUmbracoEntity
Type Parameters
| Name |
Description |
| TId |
|
| TEntity |
|
Properties
View Source
RecycleBinId
Gets the recycle bin identifier.
Declaration
int RecycleBinId { get; }
Property Value
Methods
View Source
CheckDataIntegrity(ContentDataIntegrityReportOptions)
Declaration
ContentDataIntegrityReport CheckDataIntegrity(ContentDataIntegrityReportOptions options)
Parameters
Returns
View Source
Count(string?)
Gets the count of content items of a given content type.
Declaration
int Count(string? contentTypeAlias = null)
Parameters
| Type |
Name |
Description |
| string |
contentTypeAlias |
|
Returns
View Source
CountChildren(int, string?)
Gets the count of child content items of a given parent content, of a given content type.
Declaration
int CountChildren(int parentId, string? contentTypeAlias = null)
Parameters
| Type |
Name |
Description |
| int |
parentId |
|
| string |
contentTypeAlias |
|
Returns
View Source
CountDescendants(int, string?)
Gets the count of descendant content items of a given parent content, of a given content type.
Declaration
int CountDescendants(int parentId, string? contentTypeAlias = null)
Parameters
| Type |
Name |
Description |
| int |
parentId |
|
| string |
contentTypeAlias |
|
Returns
View Source
DeleteVersion(int)
Declaration
void DeleteVersion(int versionId)
Parameters
| Type |
Name |
Description |
| int |
versionId |
|
View Source
DeleteVersions(int, DateTime)
Deletes all versions older than a date.
Declaration
void DeleteVersions(int nodeId, DateTime versionDate)
Parameters
| Type |
Name |
Description |
| int |
nodeId |
|
| DateTime |
versionDate |
|
View Source
GetAllVersions(int)
Declaration
IEnumerable<TEntity> GetAllVersions(int nodeId)
Parameters
| Type |
Name |
Description |
| int |
nodeId |
|
Returns
| Type |
Description |
| IEnumerable<TEntity> |
|
View Source
GetAllVersionsSlim(int, int, int)
Declaration
IEnumerable<TEntity> GetAllVersionsSlim(int nodeId, int skip, int take)
Parameters
| Type |
Name |
Description |
| int |
nodeId |
|
| int |
skip |
|
| int |
take |
|
Returns
| Type |
Description |
| IEnumerable<TEntity> |
|
View Source
GetPage(IQuery<TEntity>?, long, int, out long, IQuery<TEntity>?, Ordering?)
Gets paged content items.
Declaration
IEnumerable<TEntity> GetPage(IQuery<TEntity>? query, long pageIndex, int pageSize, out long totalRecords, IQuery<TEntity>? filter, Ordering? ordering)
Parameters
| Type |
Name |
Description |
| IQuery<TEntity> |
query |
|
| long |
pageIndex |
|
| int |
pageSize |
|
| long |
totalRecords |
|
| IQuery<TEntity> |
filter |
|
| Ordering |
ordering |
|
Returns
| Type |
Description |
| IEnumerable<TEntity> |
|
View Source
GetRecycleBin()
Gets the recycle bin content.
Declaration
IEnumerable<TEntity> GetRecycleBin()
Returns
| Type |
Description |
| IEnumerable<TEntity> |
|
View Source
GetVersion(int)
Declaration
TEntity? GetVersion(int versionId)
Parameters
| Type |
Name |
Description |
| int |
versionId |
|
Returns
View Source
GetVersionIds(int, int)
Gets version identifiers.
Declaration
IEnumerable<int> GetVersionIds(int id, int topRows)
Parameters
| Type |
Name |
Description |
| int |
id |
|
| int |
topRows |
|
Returns
| Type |
Description |
| IEnumerable<int> |
|