View Source
Class ContentRepositoryBase<TId, TEntity, TRepository>
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
Syntax
public abstract class ContentRepositoryBase<TId, TEntity, TRepository> : EntityRepositoryBase<TId, TEntity>, IContentRepository<TId, TEntity>, IReadWriteQueryRepository<TId, TEntity>, IReadRepository<TId, TEntity>, IWriteRepository<TEntity>, IQueryRepository<TEntity>, IRepository where TEntity : class, IContentBase where TRepository : class, IRepository
Type Parameters
Name |
Description |
TId |
|
TEntity |
|
TRepository |
|
Constructors
View Source
ContentRepositoryBase(IScopeAccessor, AppCaches, ILogger<EntityRepositoryBase<TId, TEntity>>, ILanguageRepository, IRelationRepository, IRelationTypeRepository, PropertyEditorCollection, DataValueReferenceFactoryCollection, IDataTypeService, IEventAggregator)
Declaration
protected ContentRepositoryBase(IScopeAccessor scopeAccessor, AppCaches cache, ILogger<EntityRepositoryBase<TId, TEntity>> logger, ILanguageRepository languageRepository, IRelationRepository relationRepository, IRelationTypeRepository relationTypeRepository, PropertyEditorCollection propertyEditors, DataValueReferenceFactoryCollection dataValueReferenceFactories, IDataTypeService dataTypeService, IEventAggregator eventAggregator)
Parameters
Properties
View Source
DataTypeService
Declaration
protected IDataTypeService DataTypeService { get; }
Property Value
View Source
LanguageRepository
Declaration
protected ILanguageRepository LanguageRepository { get; }
Property Value
View Source
NodeObjectTypeId
Gets the node object type for the repository's entity
Declaration
protected abstract Guid NodeObjectTypeId { get; }
Property Value
View Source
PropertyEditors
Declaration
protected PropertyEditorCollection PropertyEditors { get; }
Property Value
View Source
RecycleBinId
Declaration
public abstract int RecycleBinId { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
RelationRepository
Declaration
protected IRelationRepository RelationRepository { get; }
Property Value
View Source
RelationTypeRepository
Declaration
protected IRelationTypeRepository RelationTypeRepository { get; }
Property Value
View Source
This
Declaration
protected abstract TRepository This { get; }
Property Value
Type |
Description |
TRepository |
|
Methods
View Source
ApplySystemOrdering(ref Sql<ISqlContext>, Ordering)
Declaration
protected virtual string ApplySystemOrdering(ref Sql<ISqlContext> sql, Ordering ordering)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
CheckDataIntegrity(ContentDataIntegrityReportOptions)
Declaration
public ContentDataIntegrityReport CheckDataIntegrity(ContentDataIntegrityReportOptions options)
Parameters
Returns
View Source
ClearEntityTags(IContentBase, ITagRepository)
Declaration
protected void ClearEntityTags(IContentBase entity, ITagRepository tagRepo)
Parameters
View Source
Count(String)
Declaration
public int Count(string contentTypeAlias = null)
Parameters
Type |
Name |
Description |
System.String |
contentTypeAlias |
|
Returns
Type |
Description |
System.Int32 |
|
View Source
CountChildren(Int32, String)
Count children of an item.
Declaration
public int CountChildren(int parentId, string contentTypeAlias = null)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
contentTypeAlias |
|
Returns
Type |
Description |
System.Int32 |
|
View Source
CountDescendants(Int32, String)
Count descendants of an item.
Declaration
public int CountDescendants(int parentId, string contentTypeAlias = null)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
contentTypeAlias |
|
Returns
Type |
Description |
System.Int32 |
|
View Source
DeleteVersion(Int32)
Declaration
public virtual void DeleteVersion(int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
versionId |
|
View Source
DeleteVersions(Int32, DateTime)
Declaration
public virtual void DeleteVersions(int nodeId, DateTime versionDate)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
DateTime |
versionDate |
|
View Source
EnsureUniqueNodeName(Int32, String, Int32)
Declaration
protected virtual string EnsureUniqueNodeName(int parentId, string nodeName, int id = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
nodeName |
|
System.Int32 |
id |
|
Returns
Type |
Description |
System.String |
|
View Source
GetAllVersions(Int32)
Declaration
public abstract IEnumerable<TEntity> GetAllVersions(int nodeId)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
Returns
Type |
Description |
IEnumerable<TEntity> |
|
View Source
GetAllVersionsSlim(Int32, Int32, Int32)
Declaration
public virtual IEnumerable<TEntity> GetAllVersionsSlim(int nodeId, int skip, int take)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
System.Int32 |
skip |
|
System.Int32 |
take |
|
Returns
Type |
Description |
IEnumerable<TEntity> |
|
View Source
GetBaseQuery(QueryType)
For Paging, repositories must support returning different query for the query type specified
Declaration
protected abstract Sql<ISqlContext> GetBaseQuery(QueryType queryType)
Parameters
Returns
View Source
GetNewChildSortOrder(Int32, Int32)
Declaration
protected virtual int GetNewChildSortOrder(int parentId, int first)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
first |
|
Returns
Type |
Description |
System.Int32 |
|
View Source
GetPage(IQuery<TEntity>, Int64, Int32, out Int64, IQuery<TEntity>, Ordering)
Declaration
public abstract 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 |
|
System.Int64 |
pageIndex |
|
System.Int32 |
pageSize |
|
System.Int64 |
totalRecords |
|
IQuery<TEntity> |
filter |
|
Ordering |
ordering |
|
Returns
Type |
Description |
IEnumerable<TEntity> |
|
View Source
GetPage<TDto>(IQuery<TEntity>, Int64, Int32, out Int64, Func<List<TDto>, IEnumerable<TEntity>>, Nullable<Sql<ISqlContext>>, Ordering)
Declaration
protected IEnumerable<TEntity> GetPage<TDto>(IQuery<TEntity> query, long pageIndex, int pageSize, out long totalRecords, Func<List<TDto>, IEnumerable<TEntity>> mapDtos, Sql<ISqlContext>? filter, Ordering ordering)
Parameters
Type |
Name |
Description |
IQuery<TEntity> |
query |
|
System.Int64 |
pageIndex |
|
System.Int32 |
pageSize |
|
System.Int64 |
totalRecords |
|
Func<List<TDto>, IEnumerable<TEntity>> |
mapDtos |
|
System.Nullable<Sql<ISqlContext>> |
filter |
|
Ordering |
ordering |
|
Returns
Type |
Description |
IEnumerable<TEntity> |
|
Type Parameters
View Source
GetParentNodeDto(Int32)
Declaration
protected virtual NodeDto GetParentNodeDto(int parentId)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
Returns
View Source
GetPropertyCollections<T>(List<ContentRepositoryBase<TId, TEntity, TRepository>.TempContent<T>>)
Declaration
protected IDictionary<int, PropertyCollection> GetPropertyCollections<T>(List<ContentRepositoryBase<TId, TEntity, TRepository>.TempContent<T>> temps)
where T : class, IContentBase
Parameters
Returns
Type Parameters
View Source
GetQuotedFieldName(String, String)
Declaration
protected string GetQuotedFieldName(string tableName, string fieldName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
fieldName |
|
Returns
Type |
Description |
System.String |
|
View Source
GetRecycleBin()
Declaration
public virtual IEnumerable<TEntity>? GetRecycleBin()
Returns
Type |
Description |
System.Nullable<IEnumerable<TEntity>> |
|
View Source
GetReservedId(Guid)
Declaration
protected virtual int GetReservedId(Guid uniqueId)
Parameters
Type |
Name |
Description |
Guid |
uniqueId |
|
Returns
Type |
Description |
System.Int32 |
|
View Source
GetVersion(Int32)
Declaration
public abstract TEntity GetVersion(int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
versionId |
|
Returns
View Source
GetVersionIds(Int32, Int32)
Declaration
public virtual IEnumerable<int> GetVersionIds(int nodeId, int maxRows)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
System.Int32 |
maxRows |
|
Returns
Type |
Description |
IEnumerable<System.Int32> |
|
View Source
InsertBefore(Sql<ISqlContext>, String, String)
Declaration
protected string InsertBefore(Sql<ISqlContext> s, string atToken, string insert)
Parameters
Type |
Name |
Description |
Sql<ISqlContext> |
s |
|
System.String |
atToken |
|
System.String |
insert |
|
Returns
Type |
Description |
System.String |
|
View Source
InsertBefore(String, String, String)
Declaration
protected string InsertBefore(string s, string atToken, string insert)
Parameters
Type |
Name |
Description |
System.String |
s |
|
System.String |
atToken |
|
System.String |
insert |
|
Returns
Type |
Description |
System.String |
|
View Source
InsertJoins(Sql<ISqlContext>, Sql<ISqlContext>)
Declaration
protected Sql<ISqlContext> InsertJoins(Sql<ISqlContext> sql, Sql<ISqlContext> joins)
Parameters
Returns
View Source
InsertPropertyValues(TEntity, Int32, out Boolean, out Nullable<HashSet<String>>)
Inserts property values for the content entity
Declaration
protected void InsertPropertyValues(TEntity entity, int publishedVersionId, out bool edited, out HashSet<string>? editedCultures)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Int32 |
publishedVersionId |
|
System.Boolean |
edited |
|
System.Nullable<HashSet<System.String>> |
editedCultures |
|
View Source
OnUowRefreshedEntity(INotification)
Declaration
protected void OnUowRefreshedEntity(INotification notification)
Parameters
View Source
OnUowRemovingEntity(IContentBase)
Declaration
protected void OnUowRemovingEntity(IContentBase entity)
Parameters
View Source
PerformDeleteVersion(Int32, Int32)
Declaration
protected abstract void PerformDeleteVersion(int id, int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.Int32 |
versionId |
|
View Source
PersistRelations(TEntity)
Declaration
protected void PersistRelations(TEntity entity)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
View Source
ReplacePropertyValues(TEntity, Int32, Int32, out Boolean, out Nullable<HashSet<String>>)
Used to atomically replace the property values for the entity version specified
Declaration
protected void ReplacePropertyValues(TEntity entity, int versionId, int publishedVersionId, out bool edited, out HashSet<string>? editedCultures)
Parameters
Type |
Name |
Description |
TEntity |
entity |
|
System.Int32 |
versionId |
|
System.Int32 |
publishedVersionId |
|
System.Boolean |
edited |
|
System.Nullable<HashSet<System.String>> |
editedCultures |
|
View Source
SetEntityTags(IContentBase, ITagRepository, IJsonSerializer)
Updates tags for an item.
Declaration
protected void SetEntityTags(IContentBase entity, ITagRepository tagRepo, IJsonSerializer serializer)
Parameters
View Source
SortorderExists(Int32, Int32)
Declaration
protected virtual bool SortorderExists(int parentId, int sortOrder)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.Int32 |
sortOrder |
|
Returns
Type |
Description |
System.Boolean |
|