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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bodu.Financial.ExchangeRates.DependencyInjection" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bodu.Financial.ExchangeRates.DependencyInjection" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Bodu.Financial.ExchangeRates.DependencyInjection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bodu.Financial.ExchangeRates.DependencyInjection --version 1.0.0
                    
#r "nuget: Bodu.Financial.ExchangeRates.DependencyInjection, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bodu.Financial.ExchangeRates.DependencyInjection@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bodu.Financial.ExchangeRates.DependencyInjection&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Bodu.Financial.ExchangeRates.DependencyInjection&version=1.0.0
                    
Install as a Cake Tool

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 TOptions through Microsoft.Extensions.Options;
  • configures a named HttpClient for the provider from the options (user agent, HTTP timeout) via IHttpClientFactory, 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.0.0 100 9/24/2026
0.7.0 171 9/24/2026