Interface IReadOnlyMoneyBag
Represents a read-only bag of monetary values in one or more currencies.
Inherited Members
Namespace: Singulink.Globalization
Assembly: Singulink.Globalization.Currency.dll
Syntax
public interface IReadOnlyMoneyBag : IReadOnlyCollection<MonetaryValue>, IEnumerable<MonetaryValue>, IEnumerable, IFormattable
Properties
Name | Description |
---|---|
Currencies | Gets the currencies that this bag contains. |
IsSorted | Gets a value indicating whether this bag is sorted by each value's currency code. |
this[Currency] | Gets the value this bag contains of the specified currency. Returns the default monetary value if it does not contain the currency. |
this[string] | Gets the value this bag contains with the specified currency code. Returns the default monetary value if it does not contain the currency. |
Registry | Gets the currency registry associated with this bag. |
Methods
Name | Description |
---|---|
Contains(MonetaryValue) | Determines whether this bag contains the specified value. |
Contains(decimal, Currency) | Determines whether this bag contains the specified amount and currency. |
Contains(decimal, string) | Determines whether this bag contains the specified amount and currency code. |
ContainsCurrency(Currency) | Determines whether this bag contains a value with the specified currency. |
ContainsCurrency(string) | Determines whether this bag contains a value with the specified currency code. |
Create(CurrencyRegistry, IEnumerable<MonetaryValue>) | Creates a bag that uses the specified currency registry and adds all the specified values. |
TryGetAmount(Currency, out decimal) | Gets the amount associated with the specified currency. |
TryGetAmount(string, out decimal) | Gets the amount associated with the specified currency code. |
TryGetValue(Currency, out MonetaryValue) | Gets the monetary value associated with the specified currency. |
TryGetValue(string, out MonetaryValue) | Gets the monetary value associated with the specified currency code. |