Table of Contents

FixerRateProviderOptions Class

Definition

Namespace
Bodu.Financial.ExchangeRates
Assembly
Bodu.Financial.ExchangeRates.Fixer.dll
Package
Bodu.Financial.ExchangeRates.Fixer 0.7.1
Source
FixerRateProviderOptions.cs

Configures how the FixerRateProvider addresses and interprets the Fixer (fixer.io) foreign-exchange REST service.

public sealed class FixerRateProviderOptions : WebRateProviderOptions
Inheritance
FixerRateProviderOptions
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 Fixer-specific: the required ApiKey presented as the access_key query parameter, and the TimeSeriesPath and HistoricalPath templates. 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.

Fixer denominates its response against a base currency (EUR on the free plan; an arbitrary base on paid plans) and returns the requested quote symbols. A request for a base 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

FixerRateProviderOptions()

Initializes a new instance of the FixerRateProviderOptions class with the Fixer host as its base address and a history floor at the January 1999 inception of Fixer's historical data.

public FixerRateProviderOptions()

Properties

ApiKey

Gets or sets the Fixer 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 template used when a request covers exactly one day. The {date} placeholder is replaced by the ISO date before the request is issued.

public string HistoricalPath { get; set; }

Property Value

string

The historical path template; defaults to {date}.

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 Fixer-specific options, ensuring the access key is present and the endpoint templates are usable.

protected override bool TryValidateCore(out string? error)

Parameters

error string

When this method returns false, a message describing the violated invariant; otherwise null.

Returns

bool

true when every Fixer-specific invariant holds; otherwise false.

Applies to

ProductVersions
.NET8, 10