YahooRateProviderOptions Class
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.Yahoo.dll
- Package
- Bodu.Financial.ExchangeRates.Yahoo 0.7.1
Configures how the YahooRateProvider addresses and interprets the Yahoo Finance chart REST service.
public sealed class YahooRateProviderOptions : WebRateProviderOptions
- Inheritance
-
YahooRateProviderOptions
- 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 Yahoo-specific: the ChartPath template and the SymbolFormat used to build the foreign-exchange ticker. The chart bar interval is fixed at one day, and the date range is supplied per call through the provider's lookup and range methods.
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
YahooRateProviderOptions()
Initializes a new instance of the YahooRateProviderOptions class with the Yahoo Finance host as its base address and a fixed history floor at the chart data's December 2003 inception.
public YahooRateProviderOptions()
Remarks
The advertised HistoryAvailability is advisory: individual pairs may start later than the December 2003 inception of the longest-running pairs. Override the property when the pairs in use are known to have a later floor.
Properties
ChartPath
Gets or sets the relative chart-endpoint path template. The {symbol} placeholder is replaced by the
foreign-exchange ticker before the request is issued.
public string ChartPath { get; set; }
Property Value
- string
The chart path template; defaults to
v8/finance/chart/{symbol}.
SymbolFormat
Gets or sets the template used to build a Yahoo foreign-exchange ticker from a currency pair. The {from}
and {to} placeholders are replaced by the source and destination currency codes.
public string SymbolFormat { get; set; }
Property Value
- string
The ticker template; defaults to
{from}{to}=X(for example,AUDUSD=X).
Methods
TryValidateCore(out string?)
Validates the Yahoo-specific options, ensuring the chart path and ticker template carry their placeholders.
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 |