Bodu.Financial.DependencyInjection 0.6.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bodu.Financial.DependencyInjection --version 0.6.0
                    
NuGet\Install-Package Bodu.Financial.DependencyInjection -Version 0.6.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.DependencyInjection" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bodu.Financial.DependencyInjection" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Bodu.Financial.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.DependencyInjection --version 0.6.0
                    
#r "nuget: Bodu.Financial.DependencyInjection, 0.6.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.DependencyInjection@0.6.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.DependencyInjection&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Bodu.Financial.DependencyInjection&version=0.6.0
                    
Install as a Cake Tool

Bodu.Financial.DependencyInjection

API stability — Stable. The public API surface is committed; breaking changes are reserved for a major-version bump per SemVer.

Microsoft.Extensions.DependencyInjection integration for Bodu.Financial. Registers currency lookup, financial options, exchange-rate providers, and named monetary contexts behind a small fluent builder. Financial JSON registration (AddFinancialJson) ships in the companion Bodu.Financial.Serialization.Json package.

Installation

dotnet add package Bodu.Financial.DependencyInjection

Targets net8.0. The registration extension methods, the IFinancialServiceBuilder builder, and FinancialOptions live in the Bodu.Financial namespace.

Registration

using Bodu.Financial;
using Bodu.Financial.Serialization.Json;   // Bodu.Financial.Serialization.Json package (optional, for AddFinancialJson)

services.AddFinancialService(configuration, sectionName: "Financial")
    .AddExchangeRateProvider<EcbRateProvider>()
    .AddMonetaryContext("au", auContext);

services.AddFinancialJson(FinancialJsonPolicy.Strict);
Entry point Purpose
AddFinancialService(IConfiguration?, string) Register ICurrencyLookup, bind FinancialOptions, return an IFinancialServiceBuilder
AddFinancialService(Action<IFinancialServiceBuilder>) Register core services and compose fluently
IFinancialServiceBuilder.AddCurrencyLookup<TLookup>() Replace the registered ICurrencyLookup
.AddExchangeRateProvider<T>() / (instance) Register an IRateProvider
.AddDatedExchangeRateProvider<T>() / (instance) Register an IDatedRateProvider
.AddMonetaryContext(name, context) Register a named MonetaryContext as a keyed singleton
IServiceProvider.UseCurrencyResolution() Install the container's ICurrencyLookup as the process-wide ambient resolver

FinancialOptions is bound from the supplied configuration section (default "Financial"); it currently declares no settings of its own and exists as the binding seam for future options. The JSON registration services.AddFinancialJson(policy) (a JsonSerializerOptions keyed "Financial" with the financial converters) lives in the companion Bodu.Financial.Serialization.Json package.

Testing

dotnet test Bodu.Financial.DependencyInjection/test/Bodu.Financial.DependencyInjection.Test.csproj --settings bvt.runsettings

License

MIT. © Bodu Pty. Ltd.

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 was computed.  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 (13)

Showing the top 5 NuGet packages that depend on Bodu.Financial.DependencyInjection:

Package Downloads
Bodu.Financial.ExchangeRates.DependencyInjection

Shared dependency-injection machinery for Bodu.Financial web-based exchange-rate providers. Exposes AddWebRateProvider on IFinancialServiceBuilder, handling HttpClient configuration with Polly resilience, options binding, and singleton registration so each provider package delegates its registration plumbing here.

Bodu.Financial.ExchangeRates.Caching

Caching layer for Bodu.Financial exchange-rate providers. Provides CachingRateProvider, a decorator that wraps any IDatedRateProvider and serves fresh rates from a shared on-disk cache (one TOML file per provider and currency pair), plus an AggregatingRateProvider (priority-fallback, averaging, per-pair routing). Includes the dependency-injection registrations (AddCachedRateProvider, AddAggregatedRateProvider) on 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.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.ExchangeRateHost

exchangerate.host exchange-rate provider for Bodu.Financial. Fetches and parses the exchangerate.host time-series and historical JSON endpoints 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 (AddExchangeRateHostExchangeRates) for IServiceCollection and IFinancialServiceBuilder.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 118 9/24/2026
0.7.0 194 9/24/2026
0.6.0 66 9/24/2026