Class Cache
Represents a generic cache where the items have no expiration.
Inheritance
System.Object
Cache
Namespace: Solti.Utils.Primitives
Assembly: Solti.Utils.Primitives.dll
Syntax
public static class Cache : Object
Methods
Clear<TKey, TValue>()
Clears the underlying store associated with the given key and value type.
Declaration
public static void Clear<TKey, TValue>()
where TValue : class
Type Parameters
Name | Description |
---|---|
TKey | |
TValue |
GetOrAdd<TKey, TValue>(TKey, Func<TKey, TValue>, String)
Does what its name suggests.
Declaration
public static TValue GetOrAdd<TKey, TValue>(TKey key, Func<TKey, TValue> factory, string scope = "")
where TValue : class
Parameters
Type | Name | Description |
---|---|---|
TKey | key | |
System.Func<TKey, TValue> | factory | |
System.String | scope |
Returns
Type | Description |
---|---|
TValue |
Type Parameters
Name | Description |
---|---|
TKey | |
TValue |