Table of Contents

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

fromIsoCode string

The source-currency ISO code.

toIsoCode string

The destination-currency ISO code.

startDate DateOnly

The inclusive start of the range.

endDate DateOnly

The inclusive end of the range.

cancellationToken CancellationToken

A 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

ProductVersions
.NET8, 10