Search Results for

    Show / Hide Table of Contents

    Class ContentRepositoryBase<TId, TEntity, TRepository>

    Inheritance
    System.Object
    RepositoryBase
    EntityRepositoryBase<TId, TEntity>
    Namespace: Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
    Assembly: cs.temp.dll.dll
    Syntax
    public abstract class ContentRepositoryBase<TId, TEntity, TRepository> : EntityRepositoryBase<TId, TEntity> where TEntity : class, IContentBase where TRepository : class, IRepository
    Type Parameters
    Name Description
    TId
    TEntity
    TRepository

    Constructors

    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

    DataTypeService

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

    LanguageRepository

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

    NodeObjectTypeId

    Gets the node object type for the repository's entity

    Declaration
    protected abstract Guid NodeObjectTypeId { get; }
    Property Value
    Type Description
    System.Guid

    PropertyEditors

    Declaration
    protected PropertyEditorCollection PropertyEditors { get; }
    Property Value
    Type Description
    PropertyEditorCollection

    RecycleBinId

    Declaration
    public abstract int RecycleBinId { get; }
    Property Value
    Type Description
    System.Int32

    RelationRepository

    Declaration
    protected IRelationRepository RelationRepository { get; }
    Property Value
    Type Description
    IRelationRepository

    RelationTypeRepository

    Declaration
    protected IRelationTypeRepository RelationTypeRepository { get; }
    Property Value
    Type Description
    IRelationTypeRepository

    This

    Declaration
    protected abstract TRepository This { get; }
    Property Value
    Type Description
    TRepository

    Methods

    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

    CheckDataIntegrity(ContentDataIntegrityReportOptions)

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

    ClearEntityTags(IContentBase, ITagRepository)

    Clears tags for an item.

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

    Count(String)

    Count items.

    Declaration
    public int Count(string contentTypeAlias = null)
    Parameters
    Type Name Description
    System.String contentTypeAlias
    Returns
    Type Description
    System.Int32

    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

    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

    DeleteVersion(Int32)

    Declaration
    public virtual void DeleteVersion(int versionId)
    Parameters
    Type Name Description
    System.Int32 versionId

    DeleteVersions(Int32, DateTime)

    Declaration
    public virtual void DeleteVersions(int nodeId, DateTime versionDate)
    Parameters
    Type Name Description
    System.Int32 nodeId
    System.DateTime versionDate

    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

    GetAllVersions(Int32)

    Declaration
    public abstract IEnumerable<TEntity> GetAllVersions(int nodeId)
    Parameters
    Type Name Description
    System.Int32 nodeId
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<TEntity>

    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
    System.Collections.Generic.IEnumerable<TEntity>

    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>

    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

    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
    System.Collections.Generic.IEnumerable<TEntity>

    GetPage<TDto>(IQuery<TEntity>, Int64, Int32, out Int64, Func<List<TDto>, IEnumerable<TEntity>>, 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
    System.Func<System.Collections.Generic.List<TDto>, System.Collections.Generic.IEnumerable<TEntity>> mapDtos
    Sql<ISqlContext> filter
    Ordering ordering
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<TEntity>
    Type Parameters
    Name Description
    TDto

    GetParentNodeDto(Int32)

    Declaration
    protected virtual NodeDto GetParentNodeDto(int parentId)
    Parameters
    Type Name Description
    System.Int32 parentId
    Returns
    Type Description
    NodeDto

    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
    System.Collections.Generic.List<ContentRepositoryBase.TempContent<T>> temps
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.Int32, PropertyCollection>
    Type Parameters
    Name Description
    T

    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

    GetRecycleBin()

    Declaration
    public virtual IEnumerable<TEntity> GetRecycleBin()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<TEntity>

    GetReservedId(Guid)

    Declaration
    protected virtual int GetReservedId(Guid uniqueId)
    Parameters
    Type Name Description
    System.Guid uniqueId
    Returns
    Type Description
    System.Int32

    GetVersion(Int32)

    Declaration
    public abstract TEntity GetVersion(int versionId)
    Parameters
    Type Name Description
    System.Int32 versionId
    Returns
    Type Description
    TEntity

    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
    System.Collections.Generic.IEnumerable<System.Int32>

    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

    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

    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>

    InsertPropertyValues(TEntity, Int32, out Boolean, out 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
    HashSet<System.String> editedCultures
    Remarks

    Used when creating a new entity

    OnUowRefreshedEntity(INotification)

    Publishes a notification, used to publish for caching purposes.

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

    OnUowRemovingEntity(IContentBase)

    Declaration
    protected void OnUowRemovingEntity(IContentBase entity)
    Parameters
    Type Name Description
    IContentBase entity

    PerformDeleteVersion(Int32, Int32)

    Declaration
    protected abstract void PerformDeleteVersion(int id, int versionId)
    Parameters
    Type Name Description
    System.Int32 id
    System.Int32 versionId

    PersistRelations(TEntity)

    Declaration
    protected void PersistRelations(TEntity entity)
    Parameters
    Type Name Description
    TEntity entity

    ReplacePropertyValues(TEntity, Int32, Int32, out Boolean, out 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
    HashSet<System.String> editedCultures

    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
    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>>, 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 HashSet<String>)
      • OnUowRefreshedEntity(INotification)
      • OnUowRemovingEntity(IContentBase)
      • PerformDeleteVersion(Int32, Int32)
      • PersistRelations(TEntity)
      • ReplacePropertyValues(TEntity, Int32, Int32, out Boolean, out HashSet<String>)
      • SetEntityTags(IContentBase, ITagRepository, IJsonSerializer)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX