Search Results for

    Show / Hide Table of Contents

    Class DefaultRepositoryCachePolicy<TEntity, TId>

    Represents the default cache policy.

    Inheritance
    System.Object
    RepositoryCachePolicyBase<TEntity, TId>
    Namespace: Umbraco.Cms.Core.Cache
    Assembly: cs.temp.dll.dll
    Syntax
    public class DefaultRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId> where TEntity : class, IEntity
    Type Parameters
    Name Description
    TEntity

    The type of the entity.

    TId

    The type of the identifier.

    Remarks

    The default cache policy caches entities with a 5 minutes sliding expiration.

    Each entity is cached individually.

    If options.GetAllCacheAllowZeroCount then a 'zero-count' array is cached when GetAll finds nothing.

    If options.GetAllCacheValidateCount then we check against the db when getting many entities.

    Constructors

    DefaultRepositoryCachePolicy(IAppPolicyCache, IScopeAccessor, RepositoryCachePolicyOptions)

    Declaration
    public DefaultRepositoryCachePolicy(IAppPolicyCache cache, IScopeAccessor scopeAccessor, RepositoryCachePolicyOptions options)
    Parameters
    Type Name Description
    IAppPolicyCache cache
    IScopeAccessor scopeAccessor
    RepositoryCachePolicyOptions options

    Properties

    EntityTypeCacheKey

    Declaration
    protected string EntityTypeCacheKey { get; }
    Property Value
    Type Description
    System.String

    Methods

    ClearAll()

    Declaration
    public override void ClearAll()

    Create(TEntity, Action<TEntity>)

    Declaration
    public override void Create(TEntity entity, Action<TEntity> persistNew)
    Parameters
    Type Name Description
    TEntity entity
    System.Action<TEntity> persistNew

    Delete(TEntity, Action<TEntity>)

    Declaration
    public override void Delete(TEntity entity, Action<TEntity> persistDeleted)
    Parameters
    Type Name Description
    TEntity entity
    System.Action<TEntity> persistDeleted

    Exists(TId, Func<TId, Boolean>, Func<TId[], IEnumerable<TEntity>>)

    Declaration
    public override bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>> performGetAll)
    Parameters
    Type Name Description
    TId id
    System.Func<TId, System.Boolean> performExists
    System.Func<TId[], System.Collections.Generic.IEnumerable<TEntity>> performGetAll
    Returns
    Type Description
    System.Boolean

    Get(TId, Func<TId, TEntity>, Func<TId[], IEnumerable<TEntity>>)

    Declaration
    public override TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>> performGetAll)
    Parameters
    Type Name Description
    TId id
    System.Func<TId, TEntity> performGet
    System.Func<TId[], System.Collections.Generic.IEnumerable<TEntity>> performGetAll
    Returns
    Type Description
    TEntity

    GetAll(TId[], Func<TId[], IEnumerable<TEntity>>)

    Declaration
    public override TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> performGetAll)
    Parameters
    Type Name Description
    TId[] ids
    System.Func<TId[], System.Collections.Generic.IEnumerable<TEntity>> performGetAll
    Returns
    Type Description
    TEntity[]

    GetCached(TId)

    Declaration
    public override TEntity GetCached(TId id)
    Parameters
    Type Name Description
    TId id
    Returns
    Type Description
    TEntity

    GetEntityCacheKey(TId)

    Declaration
    protected string GetEntityCacheKey(TId id)
    Parameters
    Type Name Description
    TId id
    Returns
    Type Description
    System.String

    GetEntityCacheKey(Int32)

    Declaration
    protected string GetEntityCacheKey(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    System.String

    InsertEntities(TId[], TEntity[])

    Declaration
    protected virtual void InsertEntities(TId[] ids, TEntity[] entities)
    Parameters
    Type Name Description
    TId[] ids
    TEntity[] entities

    InsertEntity(String, TEntity)

    Declaration
    protected virtual void InsertEntity(string cacheKey, TEntity entity)
    Parameters
    Type Name Description
    System.String cacheKey
    TEntity entity

    Update(TEntity, Action<TEntity>)

    Declaration
    public override void Update(TEntity entity, Action<TEntity> persistUpdated)
    Parameters
    Type Name Description
    TEntity entity
    System.Action<TEntity> persistUpdated
    In This Article
    • Constructors
      • DefaultRepositoryCachePolicy(IAppPolicyCache, IScopeAccessor, RepositoryCachePolicyOptions)
    • Properties
      • EntityTypeCacheKey
    • Methods
      • ClearAll()
      • Create(TEntity, Action<TEntity>)
      • Delete(TEntity, Action<TEntity>)
      • Exists(TId, Func<TId, Boolean>, Func<TId[], IEnumerable<TEntity>>)
      • Get(TId, Func<TId, TEntity>, Func<TId[], IEnumerable<TEntity>>)
      • GetAll(TId[], Func<TId[], IEnumerable<TEntity>>)
      • GetCached(TId)
      • GetEntityCacheKey(TId)
      • GetEntityCacheKey(Int32)
      • InsertEntities(TId[], TEntity[])
      • InsertEntity(String, TEntity)
      • Update(TEntity, Action<TEntity>)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX