Table of Contents

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

culture CultureInfo

The 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

code CurrencyCode

The active ISO 4217 currency code.

currency CurrencyInfo

When this method returns true, the matching currency.

Returns

bool

true when a currency was found; otherwise false.

TryByIsoCode(string, out CurrencyInfo)

Attempts to resolve a currency by its ISO 4217 alphabetic code.

bool TryByIsoCode(string isoCode, out CurrencyInfo currency)

Parameters

isoCode string

The three-letter uppercase ISO code.

currency CurrencyInfo

When this method returns true, the matching currency.

Returns

bool

true when a currency was found; otherwise false.

TryByNumericCode(int, out CurrencyInfo)

Attempts to resolve a currency by its ISO 4217 numeric code.

bool TryByNumericCode(int numericCode, out CurrencyInfo currency)

Parameters

numericCode int

The three-digit numeric code.

currency CurrencyInfo

When this method returns true, the matching currency.

Returns

bool

true when a currency was found; otherwise false.

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

regionCode string

The ISO 3166 region code.

matches IReadOnlyList<CurrencyInfo>

When this method returns true, the matching currencies.

Returns

bool

true when at least one currency was found; otherwise false.

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

symbol string

The currency symbol.

matches IReadOnlyList<CurrencyInfo>

When this method returns true, the matching currencies.

Returns

bool

true when at least one currency was found; otherwise false.

Applies to

ProductVersions
.NET8, 10