OandaRateProviderOptions Class
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.Oanda.dll
- Package
- Bodu.Financial.ExchangeRates.Oanda 0.7.1 (not published on nuget.org)
Configures how the OandaRateProvider addresses and interprets the OANDA Historical Currency Converter rate-history service.
public sealed class OandaRateProviderOptions : WebRateProviderOptions
- Inheritance
-
OandaRateProviderOptions
- 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 OANDA-specific: the data and priming paths, the rate source, the price basis, the reporting period, and the rate adjustment. The anonymous endpoint serves only a rolling recent window, so the constructor sets HistoryAvailability to a 180-day rolling window and the response is range-filtered to the requested dates.
Every member carries a working default, so the options bind cleanly through Microsoft.Extensions.Options and
require no configuration for the common case. The dependency-injection package binds this type from configuration
and a configure delegate.
Constructors
OandaRateProviderOptions()
Initializes a new instance of the OandaRateProviderOptions class with the OANDA Historical Currency Converter host as its base address and a 180-day rolling history window.
public OandaRateProviderOptions()
Properties
Adjustment
Gets or sets the rate adjustment requested from the OANDA endpoint.
public int Adjustment { get; set; }
Property Value
- int
The
adjustmentquery value; defaults to 0.
Period
Gets or sets the reporting period requested from the OANDA endpoint.
public string Period { get; set; }
Property Value
- string
The
periodquery value, for exampledaily,weekly, ormonthly. Defaults todaily.
Price
Gets or sets the price basis requested from the OANDA endpoint.
public string Price { get; set; }
Property Value
- string
The
pricequery value; one ofbid,mid, orask. Defaults tomid.
PrimePath
Gets or sets the relative path requested once to obtain the session cookie the data endpoint requires.
public string PrimePath { get; set; }
Property Value
- string
The priming path; defaults to the empty string, which resolves to BaseAddress.
Source
Gets or sets the rate source requested from the OANDA endpoint.
public string Source { get; set; }
Property Value
- string
The
sourcequery value; defaults toOANDA(OANDA Rates).
UpdatePath
Gets or sets the relative path of the rate-history data endpoint.
public string UpdatePath { get; set; }
Property Value
- string
The data path; defaults to
api/data/update/.
Methods
TryValidateCore(out string?)
Validates the OANDA-specific options, ensuring the data path, source, and period are specified and the price basis is recognized.
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 |