Class CacheRefresherBase<TNotification>
A base class for cache refreshers that handles events.
Inheritance
System.Object
Namespace: Umbraco.Cms.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public abstract class CacheRefresherBase<TNotification> : ICacheRefresher, IDiscoverable where TNotification : CacheRefresherNotification
Type Parameters
Name | Description |
---|---|
TNotification |
Remarks
The actual cache refresher type is used for strongly typed events.
Constructors
View SourceCacheRefresherBase(AppCaches, IEventAggregator, ICacheRefresherNotificationFactory)
Initializes a new instance of the CacheRefresherBase<TNotification>.
Declaration
protected CacheRefresherBase(AppCaches appCaches, IEventAggregator eventAggregator, ICacheRefresherNotificationFactory factory)
Parameters
Type | Name | Description |
---|---|---|
AppCaches | appCaches | |
IEventAggregator | eventAggregator | |
ICacheRefresherNotificationFactory | factory |
Properties
View SourceAppCaches
Gets the cache helper.
Declaration
protected AppCaches AppCaches { get; }
Property Value
Type | Description |
---|---|
AppCaches |
EventAggregator
Declaration
protected IEventAggregator EventAggregator { get; }
Property Value
Type | Description |
---|---|
IEventAggregator |
Name
Gets the name of the refresher.
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
NotificationFactory
Gets the ICacheRefresherNotificationFactory for
Declaration
protected ICacheRefresherNotificationFactory NotificationFactory { get; }
Property Value
Type | Description |
---|---|
ICacheRefresherNotificationFactory |
RefresherUniqueId
Gets the unique identifier of the refresher.
Declaration
public abstract Guid RefresherUniqueId { get; }
Property Value
Type | Description |
---|---|
Guid |
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(CacheRefresherNotification)
Raises the CacheUpdated event.
Declaration
protected void OnCacheUpdated(CacheRefresherNotification notification)
Parameters
Type | Name | Description |
---|---|---|
CacheRefresherNotification | notification |
Refresh(Guid)
Refreshes an entity.
Declaration
public virtual void Refresh(Guid id)
Parameters
Type | Name | Description |
---|---|---|
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. |