Nucleus .Net Core CMS

Managers.ICacheManager Interface

Namespace: Nucleus.Abstractions.Managers
Assembly: Nucleus.Abstractions.dll
Data cache manager.

Remarks

Get an instance of this class from dependency injection by including a parameter in your class constructor.

Example

public class MyClass 
{ 
  private ICacheManager CacheManager { get; } 
  public MyClass(ICacheManager cacheManager, Context context) 
  { 
    this.CacheManager = cacheManager; 
  } 
}

Methods

Get<TKey, TModel> (String) Method

Get<TKey, TModel> (System.String)
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
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.

Collect

Collect ()
Remove expired items from all caches.
See Also
Caching Data