Constructor MoneyBag
MoneyBag()
Declaration
public MoneyBag()
MoneyBag(CurrencyRegistry)
Initializes a new instance of the MoneyBag class with the specified currency registry.
Declaration
public MoneyBag(CurrencyRegistry registry)
Parameters
Type | Name | Description |
---|---|---|
CurrencyRegistry | registry |
Exceptions
Type | Condition |
---|---|
ArgumentException | Attempted to add a value with a currency that is not available in the currency registry. |
MoneyBag(IEnumerable<MonetaryValue>)
Initializes a new instance of the MoneyBag class with the Default currency registry and adds all the specified values.
Declaration
public MoneyBag(IEnumerable<MonetaryValue> values)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<MonetaryValue> | values |
Exceptions
Type | Condition |
---|---|
ArgumentException | Attempted to add a value with a currency that is not available in the currency registry. |
MoneyBag(CurrencyRegistry, IEnumerable<MonetaryValue>)
Initializes a new instance of the MoneyBag class with the specified currency registry and adds all the specified values.
Declaration
public MoneyBag(CurrencyRegistry registry, IEnumerable<MonetaryValue> values)
Parameters
Type | Name | Description |
---|---|---|
CurrencyRegistry | registry | |
IEnumerable<MonetaryValue> | values |
Exceptions
Type | Condition |
---|---|
ArgumentException | Attempted to add a value with a currency that is not available in the currency registry. |
MoneyBag(params MonetaryValue[])
Initializes a new instance of the MoneyBag class with the Default currency registry and adds all the specified values.
Declaration
public MoneyBag(params MonetaryValue[] values)
Parameters
Type | Name | Description |
---|---|---|
MonetaryValue[] | values |
Exceptions
Type | Condition |
---|---|
ArgumentException | Attempted to add a value with a currency that is not available in the currency registry. |
MoneyBag(CurrencyRegistry, params MonetaryValue[])
Initializes a new instance of the MoneyBag class with the specified currency registry and adds all the specified values.
Declaration
public MoneyBag(CurrencyRegistry registry, params MonetaryValue[] values)
Parameters
Type | Name | Description |
---|---|---|
CurrencyRegistry | registry | |
MonetaryValue[] | values |
Exceptions
Type | Condition |
---|---|
ArgumentException | Attempted to add a value with a currency that is not available in the currency registry. |
MoneyBag(ReadOnlySpan<MonetaryValue>)
Initializes a new instance of the MoneyBag class with the Default currency registry and adds all the specified values.
Declaration
public MoneyBag(ReadOnlySpan<MonetaryValue> values)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<MonetaryValue> | values |
Exceptions
Type | Condition |
---|---|
ArgumentException | Attempted to add a value with a currency that is not available in the currency registry. |
MoneyBag(CurrencyRegistry, ReadOnlySpan<MonetaryValue>)
Initializes a new instance of the MoneyBag class with the specified currency registry and adds all the specified values.
Declaration
public MoneyBag(CurrencyRegistry registry, ReadOnlySpan<MonetaryValue> values)
Parameters
Type | Name | Description |
---|---|---|
CurrencyRegistry | registry | |
ReadOnlySpan<MonetaryValue> | values |
Exceptions
Type | Condition |
---|---|
ArgumentException | Attempted to add a value with a currency that is not available in the currency registry. |