ICurrencyLookup Interface
Definition
- Namespace
- Bodu.Financial.Currencies
- Assembly
- Bodu.Financial.dll
- Package
- Bodu.Financial 1.0.0
- Source
- ICurrencyLookup.cs
Resolves CurrencyInfo metadata by ISO code, numeric code, symbol, region, or culture, providing NodaMoney-style lookup ergonomics over the runtime currency catalogue without moving currency identity into culture.
public interface ICurrencyLookup
- Extension Methods
Methods
ByCulture(CultureInfo)
Resolves the currencies associated with culture's region.
IReadOnlyList<CurrencyInfo> ByCulture(CultureInfo culture)
Parameters
cultureCultureInfoThe culture whose region currency is resolved.
Returns
- IReadOnlyList<CurrencyInfo>
The matching currencies, or an empty list when none are found.
TryByCurrencyCode(CurrencyCode, out CurrencyInfo)
Attempts to resolve a currency by its CurrencyCode enum value.
bool TryByCurrencyCode(CurrencyCode code, out CurrencyInfo currency)
Parameters
codeCurrencyCodeThe active ISO 4217 currency code.
currencyCurrencyInfoWhen this method returns true, the matching currency.
Returns
TryByIsoCode(string, out CurrencyInfo)
Attempts to resolve a currency by its ISO 4217 alphabetic code.
bool TryByIsoCode(string isoCode, out CurrencyInfo currency)
Parameters
isoCodestringThe three-letter uppercase ISO code.
currencyCurrencyInfoWhen this method returns true, the matching currency.
Returns
TryByNumericCode(int, out CurrencyInfo)
Attempts to resolve a currency by its ISO 4217 numeric code.
bool TryByNumericCode(int numericCode, out CurrencyInfo currency)
Parameters
numericCodeintThe three-digit numeric code.
currencyCurrencyInfoWhen this method returns true, the matching currency.
Returns
TryByRegion(string, out IReadOnlyList<CurrencyInfo>)
Attempts to resolve the currencies used in the region identified by regionCode.
bool TryByRegion(string regionCode, out IReadOnlyList<CurrencyInfo> matches)
Parameters
regionCodestringThe ISO 3166 region code.
matchesIReadOnlyList<CurrencyInfo>When this method returns true, the matching currencies.
Returns
TryBySymbol(string, out IReadOnlyList<CurrencyInfo>)
Attempts to resolve the currencies that use symbol as a primary or alternative symbol.
bool TryBySymbol(string symbol, out IReadOnlyList<CurrencyInfo> matches)
Parameters
symbolstringThe currency symbol.
matchesIReadOnlyList<CurrencyInfo>When this method returns true, the matching currencies.
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |