Nucleus .Net Core CMS

Managers.ICacheManager Interface

Namespace: Nucleus.Abstractions.Managers
Assembly: Nucleus.Abstractions.dll
Data cache manager.
Get an instance of this class from dependency injection by including a parameter in your class constructor.
public class MyClass 
{ 
  private ICacheManager CacheManager { get; } 
  public MyClass(ICacheManager cacheManager, Context context) 
  { 
    this.CacheManager = cacheManager; 
  } 
}
Clear (System.String)
Clear the specified cache.
ClearAll ()
Clear all caches.
Collect ()
Remove expired items from all caches.
Get<TKey, TModel> (String caller)
Get the Cache collection for the specified type and entity, or create and add a new one if it does not exist.
Type Parameters
TKey
TModel
Parameters
Name Type
caller String

A name for the cache collection. This parameter uses the CallerMemberName attribute to get the name of the class which called the method, and the value is used in logging messages.

Remarks
Cache options for the specified entity are automatically read from configuration. The configuration file key is Nucleus:CacheOptions:[caller-name]Cache. The caller should be an extension method, see Caching Data for details. Get an instance of this class from dependency injection by including a parameter in your class constructor.
Report ()
Report the current state of all caches.
Caching Data