ExchangeRateHostRateProviderOptions Class
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.ExchangeRateHost.dll
- Package
- Bodu.Financial.ExchangeRates.ExchangeRateHost 0.7.1
Configures how the ExchangeRateHostRateProvider addresses and interprets the exchangerate.host foreign-exchange REST service.
public sealed class ExchangeRateHostRateProviderOptions : WebRateProviderOptions
- Inheritance
-
ExchangeRateHostRateProviderOptions
- Inherited Members
- Extension Methods
Remarks
This type derives from WebRateProviderOptions, which supplies the endpoint base address, the HTTP
contract, the synchronous-access and look-back behaviour, the currency-alias map, and the per-concern log levels.
The members declared here are exchangerate.host-specific: the required ApiKey presented as the
access_key query parameter, and the TimeSeriesPath and HistoricalPath endpoint
paths. A pair request spanning more than a single day is served from the time-series endpoint; a single-day request
is served from the historical (single-date) endpoint, which carries the target date in a date query
parameter.
exchangerate.host denominates its response against a source currency and returns the requested quote currencies. A
request for a source or quote the account's plan does not permit surfaces as a fetch failure rather than being
pre-empted here. Every member other than ApiKey carries a working default, so the options bind
cleanly through Microsoft.Extensions.Options; the dependency-injection package binds this type from
configuration and a configure delegate.
Constructors
ExchangeRateHostRateProviderOptions()
Initializes a new instance of the ExchangeRateHostRateProviderOptions class with the exchangerate.host host as its base address and a history floor at the January 1999 inception of its historical data.
public ExchangeRateHostRateProviderOptions()
Properties
ApiKey
Gets or sets the exchangerate.host API access key presented as the access_key query parameter on every
request.
public string ApiKey { get; set; }
Property Value
- string
The API access key. There is no default; a value is required.
HistoricalPath
Gets or sets the relative single-date endpoint path used when a request covers exactly one day. The target date
is presented in a date query parameter rather than embedded in the path.
public string HistoricalPath { get; set; }
Property Value
- string
The historical path; defaults to
historical.
TimeSeriesPath
Gets or sets the relative time-series endpoint path used when a request spans more than one day.
public string TimeSeriesPath { get; set; }
Property Value
- string
The time-series path; defaults to
timeseries.
Methods
TryValidateCore(out string?)
Validates the exchangerate.host-specific options, ensuring the access key is present and the endpoint paths are 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 |