Class CacheRefresherBase<TInstanceType>
A base class for cache refreshers that handles events.
Inheritance
Namespace: Umbraco.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public abstract class CacheRefresherBase<TInstanceType> : ICacheRefresher, IDiscoverable where TInstanceType : class, ICacheRefresher
Type Parameters
Name | Description |
---|---|
TInstanceType | The actual cache refresher type. |
Remarks
The actual cache refresher type is used for strongly typed events.
Constructors
View SourceCacheRefresherBase(AppCaches)
Initializes a new instance of the CacheRefresherBase<TInstanceType>.
Declaration
protected CacheRefresherBase(AppCaches appCaches)
Parameters
Type | Name | Description |
---|---|---|
AppCaches | appCaches | A cache helper. |
Properties
View SourceAppCaches
Gets the cache helper.
Declaration
protected AppCaches AppCaches { get; }
Property Value
Type | Description |
---|---|
AppCaches |
Name
Gets the name of the refresher.
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
RefresherUniqueId
Gets the unique identifier of the refresher.
Declaration
public abstract Guid RefresherUniqueId { get; }
Property Value
Type | Description |
---|---|
System.Guid |
This
Gets the typed 'this' for events.
Declaration
protected abstract TInstanceType This { get; }
Property Value
Type | Description |
---|---|
TInstanceType |
Methods
View SourceClearAllIsolatedCacheByEntityType<TEntity>()
Clears the cache for all repository entities of a specified type.
Declaration
protected void ClearAllIsolatedCacheByEntityType<TEntity>()
where TEntity : class, IEntity
Type Parameters
Name | Description |
---|---|
TEntity | The type of the entities. |
OnCacheUpdated(TInstanceType, CacheRefresherEventArgs)
Raises the CacheUpdated event.
Declaration
protected static void OnCacheUpdated(TInstanceType sender, CacheRefresherEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
TInstanceType | sender | The event sender. |
CacheRefresherEventArgs | args | The event arguments. |
Refresh(Guid)
Refreshes an entity.
Declaration
public virtual void Refresh(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The entity's identifier. |
Refresh(Int32)
Refreshes an entity.
Declaration
public virtual void Refresh(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The entity's identifier. |
RefreshAll()
Refreshes all entities.
Declaration
public virtual void RefreshAll()
Remove(Int32)
Removes an entity.
Declaration
public virtual void Remove(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The entity's identifier. |
Events
View SourceCacheUpdated
Triggers when the cache is updated on the server.
Declaration
public static event TypedEventHandler<TInstanceType, CacheRefresherEventArgs> CacheUpdated
Event Type
Type | Description |
---|---|
TypedEventHandler<TInstanceType, CacheRefresherEventArgs> |
Remarks
Triggers on each server configured for an Umbraco project whenever a cache refresher is updated.