Class CacheEnumerableExtensions
- Namespace
- Cuemon.Extensions.Runtime.Caching
- Assembly
- Cuemon.Extensions.Runtime.Caching.dll
Extension methods for the ICacheEnumerable<TKey> interface.
public static class CacheEnumerableExtensions
- Inheritance
-
CacheEnumerableExtensions
Fields
MemoizationScope
Represents a cache with a scope of Memoization.
public const string MemoizationScope = "Memoization"
Field Value
Methods
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, CacheInvalidation, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, CacheInvalidation invalidation, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, IDependency, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, IDependency dependency, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, IEnumerable<IDependency>, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, IEnumerable<IDependency> dependencies, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, DateTime, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, DateTime absoluteExpiration, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, String, CacheInvalidation, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, string ns, CacheInvalidation invalidation, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
ns
StringThe optional namespace that provides a scope to the cache. Default is NoScope.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, String, IDependency, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, string ns, IDependency dependency, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
ns
StringThe optional namespace that provides a scope to the cache. Default is NoScope.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, String, IEnumerable<IDependency>, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, string ns, IEnumerable<IDependency> dependencies, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
ns
StringThe optional namespace that provides a scope to the cache. Default is NoScope.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, String, DateTime, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, string ns, DateTime absoluteExpiration, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
ns
StringThe optional namespace that provides a scope to the cache. Default is NoScope.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, String, TimeSpan, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, string ns, TimeSpan slidingExpiration, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
ns
StringThe optional namespace that provides a scope to the cache. Default is NoScope.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
GetOrAdd<TKey, TResult>(ICacheEnumerable<TKey>, String, TimeSpan, Func<TResult>)
Gets the value for the specified key
from the cache, or if the key
does not exists, adds a value to the cache using the specified function delegate valueFactory
.
public static TResult GetOrAdd<TKey, TResult>(this ICacheEnumerable<TKey> cache, string key, TimeSpan slidingExpiration, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
key
StringThe unique identifier for the cache entry.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a value for the
key
.
Returns
- TResult
The value for the specified
key
. This will either be the existing value if thekey
is already in the cache, or the new value returned byvalueFactory
if thekey
was not in the cache.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
Memoize<TKey, TResult>(ICacheEnumerable<TKey>, CacheInvalidation, Func<TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<TResult> Memoize<TKey, TResult>(this ICacheEnumerable<TKey> cache, CacheInvalidation invalidation, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<TResult>The function delegate used to provide a memoized value.
Returns
- Func<TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
Memoize<TKey, TResult>(ICacheEnumerable<TKey>, IDependency, Func<TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<TResult> Memoize<TKey, TResult>(this ICacheEnumerable<TKey> cache, IDependency dependency, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a memoized value.
Returns
- Func<TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
Memoize<TKey, TResult>(ICacheEnumerable<TKey>, IEnumerable<IDependency>, Func<TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<TResult> Memoize<TKey, TResult>(this ICacheEnumerable<TKey> cache, IEnumerable<IDependency> dependencies, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a memoized value.
Returns
- Func<TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
Memoize<TKey, TResult>(ICacheEnumerable<TKey>, DateTime, Func<TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<TResult> Memoize<TKey, TResult>(this ICacheEnumerable<TKey> cache, DateTime absoluteExpiration, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a memoized value.
Returns
- Func<TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
Memoize<TKey, TResult>(ICacheEnumerable<TKey>, TimeSpan, Func<TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<TResult> Memoize<TKey, TResult>(this ICacheEnumerable<TKey> cache, TimeSpan slidingExpiration, Func<TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<TResult>The function delegate used to provide a memoized value.
Returns
- Func<TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
TResult
The type of the value in the cache.
Memoize<TKey, T, TResult>(ICacheEnumerable<TKey>, CacheInvalidation, Func<T, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T, TResult> Memoize<TKey, T, TResult>(this ICacheEnumerable<TKey> cache, CacheInvalidation invalidation, Func<T, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<T, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T
The type of the parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T, TResult>(ICacheEnumerable<TKey>, IDependency, Func<T, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T, TResult> Memoize<TKey, T, TResult>(this ICacheEnumerable<TKey> cache, IDependency dependency, Func<T, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T
The type of the parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T, TResult>(ICacheEnumerable<TKey>, IEnumerable<IDependency>, Func<T, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T, TResult> Memoize<TKey, T, TResult>(this ICacheEnumerable<TKey> cache, IEnumerable<IDependency> dependencies, Func<T, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T
The type of the parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T, TResult>(ICacheEnumerable<TKey>, DateTime, Func<T, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T, TResult> Memoize<TKey, T, TResult>(this ICacheEnumerable<TKey> cache, DateTime absoluteExpiration, Func<T, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T
The type of the parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T, TResult>(ICacheEnumerable<TKey>, TimeSpan, Func<T, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T, TResult> Memoize<TKey, T, TResult>(this ICacheEnumerable<TKey> cache, TimeSpan slidingExpiration, Func<T, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T
The type of the parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, TResult>(ICacheEnumerable<TKey>, CacheInvalidation, Func<T1, T2, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, TResult> Memoize<TKey, T1, T2, TResult>(this ICacheEnumerable<TKey> cache, CacheInvalidation invalidation, Func<T1, T2, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<T1, T2, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, TResult>(ICacheEnumerable<TKey>, IDependency, Func<T1, T2, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, TResult> Memoize<TKey, T1, T2, TResult>(this ICacheEnumerable<TKey> cache, IDependency dependency, Func<T1, T2, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, TResult>(ICacheEnumerable<TKey>, IEnumerable<IDependency>, Func<T1, T2, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, TResult> Memoize<TKey, T1, T2, TResult>(this ICacheEnumerable<TKey> cache, IEnumerable<IDependency> dependencies, Func<T1, T2, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, TResult>(ICacheEnumerable<TKey>, DateTime, Func<T1, T2, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, TResult> Memoize<TKey, T1, T2, TResult>(this ICacheEnumerable<TKey> cache, DateTime absoluteExpiration, Func<T1, T2, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, TResult>(ICacheEnumerable<TKey>, TimeSpan, Func<T1, T2, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, TResult> Memoize<TKey, T1, T2, TResult>(this ICacheEnumerable<TKey> cache, TimeSpan slidingExpiration, Func<T1, T2, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, TResult>(ICacheEnumerable<TKey>, CacheInvalidation, Func<T1, T2, T3, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, TResult> Memoize<TKey, T1, T2, T3, TResult>(this ICacheEnumerable<TKey> cache, CacheInvalidation invalidation, Func<T1, T2, T3, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<T1, T2, T3, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, TResult>(ICacheEnumerable<TKey>, IDependency, Func<T1, T2, T3, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, TResult> Memoize<TKey, T1, T2, T3, TResult>(this ICacheEnumerable<TKey> cache, IDependency dependency, Func<T1, T2, T3, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, TResult>(ICacheEnumerable<TKey>, IEnumerable<IDependency>, Func<T1, T2, T3, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, TResult> Memoize<TKey, T1, T2, T3, TResult>(this ICacheEnumerable<TKey> cache, IEnumerable<IDependency> dependencies, Func<T1, T2, T3, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, TResult>(ICacheEnumerable<TKey>, DateTime, Func<T1, T2, T3, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, TResult> Memoize<TKey, T1, T2, T3, TResult>(this ICacheEnumerable<TKey> cache, DateTime absoluteExpiration, Func<T1, T2, T3, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, TResult>(ICacheEnumerable<TKey>, TimeSpan, Func<T1, T2, T3, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, TResult> Memoize<TKey, T1, T2, T3, TResult>(this ICacheEnumerable<TKey> cache, TimeSpan slidingExpiration, Func<T1, T2, T3, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, TResult>(ICacheEnumerable<TKey>, CacheInvalidation, Func<T1, T2, T3, T4, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, TResult> Memoize<TKey, T1, T2, T3, T4, TResult>(this ICacheEnumerable<TKey> cache, CacheInvalidation invalidation, Func<T1, T2, T3, T4, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<T1, T2, T3, T4, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, TResult>(ICacheEnumerable<TKey>, IDependency, Func<T1, T2, T3, T4, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, TResult> Memoize<TKey, T1, T2, T3, T4, TResult>(this ICacheEnumerable<TKey> cache, IDependency dependency, Func<T1, T2, T3, T4, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, TResult>(ICacheEnumerable<TKey>, IEnumerable<IDependency>, Func<T1, T2, T3, T4, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, TResult> Memoize<TKey, T1, T2, T3, T4, TResult>(this ICacheEnumerable<TKey> cache, IEnumerable<IDependency> dependencies, Func<T1, T2, T3, T4, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, TResult>(ICacheEnumerable<TKey>, DateTime, Func<T1, T2, T3, T4, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, TResult> Memoize<TKey, T1, T2, T3, T4, TResult>(this ICacheEnumerable<TKey> cache, DateTime absoluteExpiration, Func<T1, T2, T3, T4, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, TResult>(ICacheEnumerable<TKey>, TimeSpan, Func<T1, T2, T3, T4, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, TResult> Memoize<TKey, T1, T2, T3, T4, TResult>(this ICacheEnumerable<TKey> cache, TimeSpan slidingExpiration, Func<T1, T2, T3, T4, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, T5, TResult>(ICacheEnumerable<TKey>, CacheInvalidation, Func<T1, T2, T3, T4, T5, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, T5, TResult> Memoize<TKey, T1, T2, T3, T4, T5, TResult>(this ICacheEnumerable<TKey> cache, CacheInvalidation invalidation, Func<T1, T2, T3, T4, T5, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
invalidation
CacheInvalidationThe object that contains expiration details for a specific cache entry.
valueFactory
Func<T1, T2, T3, T4, T5, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, T5, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.T5
The type of the fifth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, T5, TResult>(ICacheEnumerable<TKey>, IDependency, Func<T1, T2, T3, T4, T5, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, T5, TResult> Memoize<TKey, T1, T2, T3, T4, T5, TResult>(this ICacheEnumerable<TKey> cache, IDependency dependency, Func<T1, T2, T3, T4, T5, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependency
IDependencyAn IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, T5, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, T5, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.T5
The type of the fifth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, T5, TResult>(ICacheEnumerable<TKey>, IEnumerable<IDependency>, Func<T1, T2, T3, T4, T5, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, T5, TResult> Memoize<TKey, T1, T2, T3, T4, T5, TResult>(this ICacheEnumerable<TKey> cache, IEnumerable<IDependency> dependencies, Func<T1, T2, T3, T4, T5, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
dependencies
IEnumerable<IDependency>A sequence of IDependency implementations that monitors changes in the state of the data which a cache entry depends on. If a state change is registered, the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, T5, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, T5, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.T5
The type of the fifth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, T5, TResult>(ICacheEnumerable<TKey>, DateTime, Func<T1, T2, T3, T4, T5, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, T5, TResult> Memoize<TKey, T1, T2, T3, T4, T5, TResult>(this ICacheEnumerable<TKey> cache, DateTime absoluteExpiration, Func<T1, T2, T3, T4, T5, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
absoluteExpiration
DateTimeThe absolute expiration date time value from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, T5, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, T5, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.T5
The type of the fifth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.
Memoize<TKey, T1, T2, T3, T4, T5, TResult>(ICacheEnumerable<TKey>, TimeSpan, Func<T1, T2, T3, T4, T5, TResult>)
Memoizes the specified valueFactory
in the cache for fast access.
public static Func<T1, T2, T3, T4, T5, TResult> Memoize<TKey, T1, T2, T3, T4, T5, TResult>(this ICacheEnumerable<TKey> cache, TimeSpan slidingExpiration, Func<T1, T2, T3, T4, T5, TResult> valueFactory)
Parameters
cache
ICacheEnumerable<TKey>The ICacheEnumerable<TKey> to extend.
slidingExpiration
TimeSpanThe sliding expiration time from when the cached entry becomes invalid and is removed from the cache.
valueFactory
Func<T1, T2, T3, T4, T5, TResult>The function delegate used to provide a memoized value.
Returns
- Func<T1, T2, T3, T4, T5, TResult>
A memoized function delegate that is otherwise equivalent to
valueFactory
.
Type Parameters
TKey
The type of the key in the cache.
T1
The type of the first parameter of the delegate
valueFactory
.T2
The type of the second parameter of the delegate
valueFactory
.T3
The type of the third parameter of the delegate
valueFactory
.T4
The type of the fourth parameter of the delegate
valueFactory
.T5
The type of the fifth parameter of the delegate
valueFactory
.TResult
The type of the value in the cache.