Bodu.Financial.ExchangeRates.DependencyInjection
1.0.0
dotnet add package Bodu.Financial.ExchangeRates.DependencyInjection --version 1.0.0
NuGet\Install-Package Bodu.Financial.ExchangeRates.DependencyInjection -Version 1.0.0
<PackageReference Include="Bodu.Financial.ExchangeRates.DependencyInjection" Version="1.0.0" />
<PackageVersion Include="Bodu.Financial.ExchangeRates.DependencyInjection" Version="1.0.0" />
<PackageReference Include="Bodu.Financial.ExchangeRates.DependencyInjection" />
paket add Bodu.Financial.ExchangeRates.DependencyInjection --version 1.0.0
#r "nuget: Bodu.Financial.ExchangeRates.DependencyInjection, 1.0.0"
#:package Bodu.Financial.ExchangeRates.DependencyInjection@1.0.0
#addin nuget:?package=Bodu.Financial.ExchangeRates.DependencyInjection&version=1.0.0
#tool nuget:?package=Bodu.Financial.ExchangeRates.DependencyInjection&version=1.0.0
Bodu.Financial.ExchangeRates.DependencyInjection
API stability — Stable. The public API surface is committed; breaking changes are reserved for a major-version bump per SemVer.
Shared dependency-injection machinery for the
Bodu.Financial web exchange-rate providers. Every per-source provider
package (Boe, Ecb, Rba, Yahoo, Ofx, Xe, Oanda, Fixer, ExchangeRateHost, Fred, Imf) delegates its own Add…
registration to the single generic extension defined here, so named-HttpClient
configuration, resilience, options binding, and provider lifetime are wired one way across
the whole family.
AddWebRateProvider
AddWebRateProvider<TProvider, TOptions> registers a WebRateProvider
subclass as a singleton, exposed as both IDatedRateProvider and
IRateProvider. It:
- binds and validates
TOptionsthroughMicrosoft.Extensions.Options; - configures a named
HttpClientfor the provider from the options (user agent, HTTP timeout) viaIHttpClientFactory, so the provider never owns the client lifetime; - layers Polly standard resilience over that client, with the attempt / total-request / circuit-breaker windows aligned to the configured timeout; and
- constructs the provider from the resolved client, options, and logger.
A provider package's public Add… method is a thin call through to this:
using Bodu.Financial.ExchangeRates;
// Inside a provider package's own extension:
public static IFinancialServiceBuilder AddAcmeExchangeRates(
this IFinancialServiceBuilder builder,
IConfiguration configuration,
string sectionName = "Financial:Acme",
Action<AcmeRateProviderOptions>? configure = null) =>
builder.AddWebRateProvider<AcmeRateProvider, AcmeRateProviderOptions>(
configuration, sectionName, configure);
Both an IConfiguration-bound overload and a code-only Action<TOptions> overload are
provided, so a provider can be registered from configuration or configured inline.
Consumers do not usually reference this package directly — they add a concrete provider
package (which brings this one transitively) and call its Add… method.
Part of the Bodu utility library.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Bodu.Core (>= 1.0.0)
- Bodu.Financial.DependencyInjection (>= 1.0.0)
- Bodu.Financial.ExchangeRates (>= 1.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Http.Resilience (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.12)
-
net8.0
- Bodu.Core (>= 1.0.0)
- Bodu.Financial.DependencyInjection (>= 1.0.0)
- Bodu.Financial.ExchangeRates (>= 1.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Http.Resilience (>= 8.10.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Bodu.Financial.ExchangeRates.DependencyInjection:
| Package | Downloads |
|---|---|
|
Bodu.Financial.ExchangeRates.Fred
FRED (Federal Reserve Bank of St. Louis) exchange-rate provider for Bodu.Financial. Maps each currency pair to a FRED foreign-exchange series, fetches and parses the series observations JSON endpoint, and serves the results as Bodu.Financial.ExchangeRates.ExchangeRate values through IDatedRateProvider and IRateProvider, with an async range API over currency pairs. Includes the dependency-injection registration extensions (AddFredExchangeRates) for IServiceCollection and IFinancialServiceBuilder. |
|
|
Bodu.Financial.ExchangeRates.Rba
Reserve Bank of Australia (RBA) historical exchange-rate provider for Bodu.Financial. Downloads and parses the RBA's published daily .xls files and serves them as Bodu.Financial.ExchangeRates.ExchangeRate values through IDatedRateProvider and IRateProvider, with an async range API and in-memory plus on-disk caching. Includes the dependency-injection registration extensions (AddRbaExchangeRates) that register the provider as a singleton backed by a configured HttpClient and bind RbaRateProviderOptions through Microsoft.Extensions.Options. |
|
|
Bodu.Financial.ExchangeRates.Ofx
OFX (ofx.com) exchange-rate provider for Bodu.Financial. Fetches and parses the OFX public spot-rate-history JSON service and serves the results as Bodu.Financial.ExchangeRates.ExchangeRate values through IDatedRateProvider and IRateProvider, with an async range API over arbitrary currency pairs. Includes the dependency-injection registration extensions (AddOfxExchangeRates) that bind OfxRateProviderOptions and configure a resilient named HttpClient. |
|
|
Bodu.Financial.ExchangeRates.Yahoo
Yahoo Finance exchange-rate provider for Bodu.Financial. Fetches and parses the Yahoo Finance v8 chart JSON service and serves the results as Bodu.Financial.ExchangeRates.ExchangeRate values through IDatedRateProvider and IRateProvider, with an async range API over arbitrary currency pairs. Includes the dependency-injection registration extensions (AddYahooExchangeRates) for IServiceCollection and IFinancialServiceBuilder. |
|
|
Bodu.Financial.ExchangeRates.Ecb
European Central Bank (ECB) euro foreign-exchange reference-rate provider for Bodu.Financial. Downloads and parses the ECB's published eurofxref XML feeds and serves them as Bodu.Financial.ExchangeRates.ExchangeRate values through IDatedRateProvider and IRateProvider, with an async range API and in-memory plus on-disk caching. Includes the dependency-injection registration extensions (AddEcbExchangeRates) for Microsoft.Extensions.DependencyInjection, with options binding and a resilient named HttpClient. |
GitHub repositories
This package is not used by any popular GitHub repositories.