IPairRateLoader Interface
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.dll
- Package
- Bodu.Financial.ExchangeRates 1.0.0
- Source
- IPairRateLoader.cs
Defines the common warm-up and discovery surface shared by every web-backed exchange-rate provider: a caller can prime a pair's window and enumerate the pairs currently held without knowing the concrete provider or how its feed is organized (per pair, per era, per feed, or per range).
public interface IPairRateLoader
- Extension Methods
Remarks
Every WebRateProvider implements this contract, so a consumer can treat a pair feed (such as Yahoo)
and a bulk feed (such as RBA, ECB, or Bank of England) uniformly for cache warming. Providers additionally expose
their own strongly-typed discovery surface (for example a GetAvailablePairs that returns feed-specific series
metadata); this interface deliberately projects only the common CurrencyPair.
Methods
GetLoadedPairs()
Gets the distinct currency pairs for which observations have been accumulated so far.
IReadOnlyCollection<CurrencyPair> GetLoadedPairs()
Returns
- IReadOnlyCollection<CurrencyPair>
A snapshot of the loaded pairs; empty when nothing has been loaded.
LoadPairAsync(string, string, DateOnly, DateOnly, CancellationToken)
Fetches and accumulates the inclusive window for a currency pair, unless that window is already covered.
Task LoadPairAsync(string fromIsoCode, string toIsoCode, DateOnly startDate, DateOnly endDate, CancellationToken cancellationToken = default)
Parameters
fromIsoCodestringThe source-currency ISO code.
toIsoCodestringThe destination-currency ISO code.
startDateDateOnlyThe inclusive start of the range.
endDateDateOnlyThe inclusive end of the range.
cancellationTokenCancellationTokenA token to observe while awaiting the fetch.
Returns
- Task
A task that completes when the pair's window has been loaded.
Exceptions
- ArgumentNullException
Thrown when an ISO code is null.
- ArgumentException
Thrown when an ISO code is malformed, the range is inverted, or the provider does not serve the requested pair.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |