Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentRepositoryBase<TId, TEntity, TRepository>

    Inheritance
    System.Object
    RepositoryBase
    EntityRepositoryBase<TId, TEntity>
    Namespace: Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
    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
    Type Name Description
    IScopeAccessor scopeAccessor
    AppCaches cache
    ILogger<EntityRepositoryBase<TId, TEntity>> logger
    ILanguageRepository languageRepository
    IRelationRepository relationRepository
    IRelationTypeRepository relationTypeRepository
    PropertyEditorCollection propertyEditors

    Lazy property value collection - must be lazy because we have a circular dependency since some property editors require services, yet these services require property editors

    DataValueReferenceFactoryCollection dataValueReferenceFactories
    IDataTypeService dataTypeService
    IEventAggregator eventAggregator

    Properties

    View Source

    DataTypeService

    Declaration
    protected IDataTypeService DataTypeService { get; }
    Property Value
    Type Description
    IDataTypeService
    View Source

    LanguageRepository

    Declaration
    protected ILanguageRepository LanguageRepository { get; }
    Property Value
    Type Description
    ILanguageRepository
    View Source

    NodeObjectTypeId

    Gets the node object type for the repository's entity

    Declaration
    protected abstract Guid NodeObjectTypeId { get; }
    Property Value
    Type Description
    Guid
    View Source

    PropertyEditors

    Declaration
    protected PropertyEditorCollection PropertyEditors { get; }
    Property Value
    Type Description
    PropertyEditorCollection
    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
    Type Description
    IRelationRepository
    View Source

    RelationTypeRepository

    Declaration
    protected IRelationTypeRepository RelationTypeRepository { get; }
    Property Value
    Type Description
    IRelationTypeRepository
    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
    Type Name Description
    Sql<ISqlContext> sql
    Ordering ordering
    Returns
    Type Description
    System.String
    View Source

    CheckDataIntegrity(ContentDataIntegrityReportOptions)

    Declaration
    public ContentDataIntegrityReport CheckDataIntegrity(ContentDataIntegrityReportOptions options)
    Parameters
    Type Name Description
    ContentDataIntegrityReportOptions options
    Returns
    Type Description
    ContentDataIntegrityReport
    View Source

    ClearEntityTags(IContentBase, ITagRepository)

    Clears tags for an item.

    Declaration
    protected void ClearEntityTags(IContentBase entity, ITagRepository tagRepo)
    Parameters
    Type Name Description
    IContentBase entity
    ITagRepository tagRepo
    View Source

    Count(String)

    Count items.

    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
    Type Name Description
    QueryType queryType
    Returns
    Type Description
    Sql<ISqlContext>
    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
    Name Description
    TDto
    View Source

    GetParentNodeDto(Int32)

    Declaration
    protected virtual NodeDto GetParentNodeDto(int parentId)
    Parameters
    Type Name Description
    System.Int32 parentId
    Returns
    Type Description
    NodeDto
    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
    Type Name Description
    List<ContentRepositoryBase.TempContent<T>> temps
    Returns
    Type Description
    IDictionary<System.Int32, PropertyCollection>
    Type Parameters
    Name Description
    T
    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
    Type Description
    TEntity
    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
    Type Name Description
    Sql<ISqlContext> sql
    Sql<ISqlContext> joins
    Returns
    Type Description
    Sql<ISqlContext>
    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
    Remarks

    Used when creating a new entity

    View Source

    OnUowRefreshedEntity(INotification)

    Publishes a notification, used to publish EntityRefreshNotification<T> for caching purposes.

    Declaration
    protected void OnUowRefreshedEntity(INotification notification)
    Parameters
    Type Name Description
    INotification notification
    View Source

    OnUowRemovingEntity(IContentBase)

    Declaration
    protected void OnUowRemovingEntity(IContentBase entity)
    Parameters
    Type Name Description
    IContentBase entity
    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
    Type Name Description
    IContentBase entity
    ITagRepository tagRepo
    IJsonSerializer serializer
    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
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ContentRepositoryBase(IScopeAccessor, AppCaches, ILogger<EntityRepositoryBase<TId, TEntity>>, ILanguageRepository, IRelationRepository, IRelationTypeRepository, PropertyEditorCollection, DataValueReferenceFactoryCollection, IDataTypeService, IEventAggregator)
    • Properties
      • DataTypeService
      • LanguageRepository
      • NodeObjectTypeId
      • PropertyEditors
      • RecycleBinId
      • RelationRepository
      • RelationTypeRepository
      • This
    • Methods
      • ApplySystemOrdering(ref Sql<ISqlContext>, Ordering)
      • CheckDataIntegrity(ContentDataIntegrityReportOptions)
      • ClearEntityTags(IContentBase, ITagRepository)
      • Count(String)
      • CountChildren(Int32, String)
      • CountDescendants(Int32, String)
      • DeleteVersion(Int32)
      • DeleteVersions(Int32, DateTime)
      • EnsureUniqueNodeName(Int32, String, Int32)
      • GetAllVersions(Int32)
      • GetAllVersionsSlim(Int32, Int32, Int32)
      • GetBaseQuery(QueryType)
      • GetNewChildSortOrder(Int32, Int32)
      • GetPage(IQuery<TEntity>, Int64, Int32, out Int64, IQuery<TEntity>, Ordering)
      • GetPage<TDto>(IQuery<TEntity>, Int64, Int32, out Int64, Func<List<TDto>, IEnumerable<TEntity>>, Nullable<Sql<ISqlContext>>, Ordering)
      • GetParentNodeDto(Int32)
      • GetPropertyCollections<T>(List<ContentRepositoryBase<TId, TEntity, TRepository>.TempContent<T>>)
      • GetQuotedFieldName(String, String)
      • GetRecycleBin()
      • GetReservedId(Guid)
      • GetVersion(Int32)
      • GetVersionIds(Int32, Int32)
      • InsertBefore(Sql<ISqlContext>, String, String)
      • InsertBefore(String, String, String)
      • InsertJoins(Sql<ISqlContext>, Sql<ISqlContext>)
      • InsertPropertyValues(TEntity, Int32, out Boolean, out Nullable<HashSet<String>>)
      • OnUowRefreshedEntity(INotification)
      • OnUowRemovingEntity(IContentBase)
      • PerformDeleteVersion(Int32, Int32)
      • PersistRelations(TEntity)
      • ReplacePropertyValues(TEntity, Int32, Int32, out Boolean, out Nullable<HashSet<String>>)
      • SetEntityTags(IContentBase, ITagRepository, IJsonSerializer)
      • SortorderExists(Int32, Int32)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX