BoeRateProviderOptions Class
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.Boe.dll
- Package
- Bodu.Financial.ExchangeRates.Boe 1.3.0
Configures how the BoeRateProvider downloads, caches, and interprets Bank of England daily spot exchange-rate data.
public sealed class BoeRateProviderOptions : WebRateProviderOptions
- Inheritance
-
BoeRateProviderOptions
- Inherited Members
- Extension Methods
Remarks
This type derives from WebRateProviderOptions, which supplies the endpoint base address, the HTTP contract (timeout, user agent and response-size cap), the synchronous-access, look-back and refresh behavior, the advertised history, the currency-alias map, and the per-concern log levels. The constructor points BaseAddress at the Interactive Statistical Database (IADB), identifies the requests with a Bodu user agent, sets a ten-day DefaultLookback, and floors the advertised history at 2 January 1975. The members declared here are Bank of England-specific: the Series catalog, the IADB QueryPath, and the on-disk cache settings.
A range request is composed from BaseAddress, QueryPath, the catalog's series codes, and the inclusive date range. The inherited RefreshInterval governs both the in-memory ranges and the on-disk cache: a cached range response older than the interval is downloaded again, and in memory a loaded range keeps for good every day before the day it was downloaded and every later day it returned a rate for, while its other days are downloaded again by a request that reaches them once the interval has passed.
The IADB names series, not currencies, so CurrencyAliases applies to the quote
label of each BoeSeries in the catalog: a label found among the keys is replaced by its value, which
must be the ISO 4217 code the provider serves the series under. Every member carries a working default, so the
options bind cleanly through Microsoft.Extensions.Options; the dependency-injection registration binds this
type from configuration and a configure delegate.
Constructors
BoeRateProviderOptions()
Initializes a new instance of the BoeRateProviderOptions class with the IADB as its base address, a Bodu user agent, a ten-day look-back, and a history floor at the 1975 inception of the daily spot series.
public BoeRateProviderOptions()
Remarks
The IADB daily spot series (XUDL*) begin on 2 January 1975 for the longest-running currencies; some
series start later (the euro series begins 4 January 1999, with the launch of the euro). The advertised history
is advisory - it bounds the earliest date worth requesting for the default Series catalog, not a
per-series guarantee - so narrow HistoryAvailability when the catalog is
restricted to later-inception series.
Properties
CacheDirectory
Gets or sets the directory used by the on-disk cache.
public string? CacheDirectory { get; set; }
Property Value
EnableDiskCache
Gets or sets a value indicating whether downloaded ranges are persisted to an on-disk cache.
public bool EnableDiskCache { get; set; }
Property Value
QueryPath
Gets or sets the relative path of the IADB CSV column query endpoint, resolved against BaseAddress.
public string QueryPath { get; set; }
Property Value
- string
The query path; defaults to
_iadb-fromshowcolumns.asp.
Series
Gets or sets the catalog of currency series to request, mapping each quote currency to its IADB series code.
public IReadOnlyList<BoeSeries> Series { get; set; }
Property Value
- IReadOnlyList<BoeSeries>
The series catalog; defaults to Default.
Methods
TryValidateCore(out string?)
Validates the Bank of England-specific options, ensuring the series catalog is not empty and the query path is usable.
protected override bool TryValidateCore(out string? error)
Parameters
errorstringWhen this method returns false, a message describing the violated invariant; otherwise null.
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |