NullByteCache<TKey> Class
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.dll
- Package
- Bodu.Financial.ExchangeRates 1.0.0
- Source
- NullByteCache{T}.cs
An IByteCache<TKey> that stores nothing, used when on-disk caching is disabled.
public sealed class NullByteCache<TKey> : IByteCache<TKey>
Type Parameters
TKeyThe type identifying a cached download unit.
- Inheritance
-
NullByteCache<TKey>
- Implements
-
IByteCache<TKey>
- Inherited Members
- Extension Methods
Properties
Instance
Gets the shared instance of the no-op cache.
public static NullByteCache<TKey> Instance { get; }
Property Value
- NullByteCache<TKey>
The singleton NullByteCache<TKey>.
Methods
Store(TKey, byte[])
Stores the bytes for a download unit, replacing any existing entry.
public void Store(TKey key, byte[] bytes)
Parameters
keyTKeyThe download unit the bytes belong to.
bytesbyte[]The response bytes to store.
TryGet(TKey, TimeSpan, out byte[])
Attempts to retrieve the cached bytes for a download unit.
public bool TryGet(TKey key, TimeSpan refreshInterval, out byte[] bytes)
Parameters
keyTKeyThe download unit to look up.
refreshIntervalTimeSpanThe maximum age at which a cached response is still considered fresh.
bytesbyte[]When this method returns true, the cached response bytes; otherwise null.
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |