Class CacheScope
Contains the simplic cache scope for parent and child caching
Inheritance
System.Object
CacheScope
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Simplic.Cache
Assembly: Simplic.Cache.dll
Syntax
public class CacheScope
Constructors
| Improve this Doc View SourceCacheScope()
Initialize new scope
Declaration
public CacheScope()
Properties
| Improve this Doc View SourceParent
Gets or sets the parent scope
Declaration
public CacheScope Parent { get; set; }
Property Value
Type | Description |
---|---|
CacheScope |
Methods
| Improve this Doc View SourceClear()
Clear cache
Declaration
public void Clear()
Get<T>(String, Func<String, T>)
Get item from cache
Declaration
public T Get<T>(string key, Func<string, T> create)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Item key |
System.Func<System.String, T> | create | Delegate for creating new items |
Returns
Type | Description |
---|---|
T | New or existing item |
Type Parameters
Name | Description |
---|---|
T | Item type |
GetScope()
Get scope to use. If no parent exists, the current scope will be used
Declaration
public CacheScope GetScope()
Returns
Type | Description |
---|---|
CacheScope | Scope instance |