Bodu.Financial.DependencyInjection
0.6.0
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
<PackageReference Include="Bodu.Financial.DependencyInjection" Version="0.6.0" />
<PackageVersion Include="Bodu.Financial.DependencyInjection" Version="0.6.0" />
<PackageReference Include="Bodu.Financial.DependencyInjection" />
paket add Bodu.Financial.DependencyInjection --version 0.6.0
#r "nuget: Bodu.Financial.DependencyInjection, 0.6.0"
#:package Bodu.Financial.DependencyInjection@0.6.0
#addin nuget:?package=Bodu.Financial.DependencyInjection&version=0.6.0
#tool nuget:?package=Bodu.Financial.DependencyInjection&version=0.6.0
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 | 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 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. |
-
net8.0
- Bodu.Core (>= 0.6.0)
- Bodu.Financial (>= 0.6.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
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.