View Source
  Class DefaultRepositoryCachePolicy<TEntity, TId>
  
  Represents the default cache policy.
    Inheritance
      System.Object
      
      
   
  
  Assembly: Umbraco.Infrastructure.dll
  Syntax
  
    public class DefaultRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId>, IRepositoryCachePolicy<TEntity, TId> where TEntity : class, IEntity
   
  Type Parameters
  
    
      
        | Name | Description | 
    
    
      
        | TEntity | The type of the entity. | 
      
        | TId | The type of the identifier. | 
    
  
  
  
  Constructors
  
  
    View Source
  
  DefaultRepositoryCachePolicy(IAppPolicyCache, IScopeAccessor, RepositoryCachePolicyOptions)
  
  
  Declaration
  
    public DefaultRepositoryCachePolicy(IAppPolicyCache cache, IScopeAccessor scopeAccessor, RepositoryCachePolicyOptions options)
   
  Parameters
  
  Properties
  
  
    View Source
  
  EntityTypeCacheKey
  
  
  Declaration
  
    protected string EntityTypeCacheKey { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  Methods
  
  
    View Source
  
  ClearAll()
  
  
  Declaration
  
    public override void ClearAll()
   
  
    View Source
  
  Create(TEntity, Action<TEntity>)
  
  
  Declaration
  
    public override void Create(TEntity entity, Action<TEntity> persistNew)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TEntity | entity |  | 
      
        | Action<TEntity> | persistNew |  | 
    
  
  
    View Source
  
  Delete(TEntity, Action<TEntity>)
  
  
  Declaration
  
    public override void Delete(TEntity entity, Action<TEntity> persistDeleted)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TEntity | entity |  | 
      
        | Action<TEntity> | persistDeleted |  | 
    
  
  
    View Source
  
  Exists(TId, Func<TId, Boolean>, Func<TId[], Nullable<IEnumerable<TEntity>>>)
  
  
  Declaration
  
    public override bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>?> performGetAll)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TId | id |  | 
      
        | Func<TId, System.Boolean> | performExists |  | 
      
        | Func<TId[], System.Nullable<IEnumerable<TEntity>>> | performGetAll |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
    View Source
  
  Get(TId, Func<TId, TEntity>, Func<TId[], Nullable<IEnumerable<TEntity>>>)
  
  
  Declaration
  
    public override TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>?> performGetAll)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TId | id |  | 
      
        | Func<TId, TEntity> | performGet |  | 
      
        | Func<TId[], System.Nullable<IEnumerable<TEntity>>> | performGetAll |  | 
    
  
  Returns
  
  
    View Source
  
  GetAll(TId[], Func<TId[], Nullable<IEnumerable<TEntity>>>)
  
  
  Declaration
  
    public override TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>?> performGetAll)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TId[] | ids |  | 
      
        | Func<TId[], System.Nullable<IEnumerable<TEntity>>> | performGetAll |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | TEntity[] |  | 
    
  
  
    View Source
  
  GetCached(TId)
  Gets an entity from the cache.
Declaration
  
    public override TEntity GetCached(TId id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TId | id | The identifier. | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | TEntity | The entity with the specified identifier, if it is in the cache already, else null. | 
    
  
  
  
  
    View Source
  
  GetEntityCacheKey(TId)
  
  
  Declaration
  
    protected string GetEntityCacheKey(TId id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TId | id |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
    View Source
  
  GetEntityCacheKey(Int32)
  
  
  Declaration
  
    protected string GetEntityCacheKey(int id)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int32 | id |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
    View Source
  
  InsertEntities(TId[], TEntity[])
  
  
  Declaration
  
    protected virtual void InsertEntities(TId[] ids, TEntity[] entities)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TId[] | ids |  | 
      
        | TEntity[] | entities |  | 
    
  
  
    View Source
  
  InsertEntity(String, TEntity)
  
  
  Declaration
  
    protected virtual void InsertEntity(string cacheKey, TEntity entity)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | cacheKey |  | 
      
        | TEntity | entity |  | 
    
  
  
    View Source
  
  InsertNull(String)
  
  
  Declaration
  
    protected virtual void InsertNull(string cacheKey)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | cacheKey |  | 
    
  
  
    View Source
  
  Update(TEntity, Action<TEntity>)
  
  
  Declaration
  
    public override void Update(TEntity entity, Action<TEntity> persistUpdated)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | TEntity | entity |  | 
      
        | Action<TEntity> | persistUpdated |  |