FileSystemEcbFeedCache Class
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.Ecb.dll
- Package
- Bodu.Financial.ExchangeRates.Ecb 0.7.1
An IByteCache<TKey> that persists downloaded ECB feeds as files in a cache directory, keyed by the feed that produced them.
public sealed class FileSystemEcbFeedCache : FileSystemByteCache<EcbRateFeed>, IByteCache<EcbRateFeed>
- Inheritance
-
FileSystemEcbFeedCache
- Implements
- Inherited Members
- Extension Methods
Remarks
Each feed is stored under its file name in the cache directory; the file's last-write time serves as the freshness timestamp. Because every ECB feed extends to the most recent business day, a cached file is treated as stale once it exceeds the supplied refresh interval, forcing a re-download.
The cache is best-effort: any I/O failure while reading is reported as a miss, and any failure while writing is swallowed, so a cache problem never breaks rate retrieval.
Constructors
FileSystemEcbFeedCache(string?, ILogger?)
Initializes a new instance of the FileSystemEcbFeedCache class.
public FileSystemEcbFeedCache(string? directory, ILogger? logger = null)
Parameters
Methods
GetFileName(EcbRateFeed)
Derives the cache file name for a key.
protected override string GetFileName(EcbRateFeed key)
Parameters
keyEcbRateFeedThe download unit to name.
Returns
- string
The cache file name.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |