Method Create
Create()
Creates an empty immutable money bag that uses the Default currency registry.
Declaration
public static ImmutableMoneyBag Create()
Returns
Create(MonetaryValue)
Creates an empty immutable money bag that uses the Default currency registry and contains the specified value.
Declaration
public static ImmutableMoneyBag Create(MonetaryValue value)
Parameters
Returns
Exceptions
Type |
Condition |
ArgumentException |
Attempted to add a value with a currency that is not available in the currency registry.
|
Create(CurrencyRegistry)
Creates an empty immutable money bag that uses the specified currency registry.
Declaration
public static ImmutableMoneyBag Create(CurrencyRegistry registry)
Parameters
Returns
Exceptions
Type |
Condition |
ArgumentException |
Attempted to add a value with a currency that is not available in the currency registry.
|
Create(CurrencyRegistry, MonetaryValue)
Creates an immutable money bag that uses the specified currency registry and contains the specified value.
Declaration
public static ImmutableMoneyBag Create(CurrencyRegistry registry, MonetaryValue value)
Parameters
Returns
Exceptions
Type |
Condition |
ArgumentException |
Attempted to add a value with a currency that is not available in the currency registry.
|
Create(params MonetaryValue[])
Creates an immutable money bag that uses the Default currency registry and adds all the specified values.
Declaration
public static ImmutableMoneyBag Create(params MonetaryValue[] values)
Parameters
Returns
Exceptions
Type |
Condition |
ArgumentException |
Attempted to add a value with a currency that is not available in the currency registry.
|
Create(CurrencyRegistry, params MonetaryValue[])
Creates an immutable money bag that uses the specified currency registry and adds all the specified values.
Declaration
public static ImmutableMoneyBag Create(CurrencyRegistry registry, params MonetaryValue[] values)
Parameters
Returns
Exceptions
Type |
Condition |
ArgumentException |
Attempted to add a value with a currency that is not available in the currency registry.
|
Create(ReadOnlySpan<MonetaryValue>)
Creates an immutable money bag that uses the Default currency registry and adds all the specified values.
Declaration
public static ImmutableMoneyBag Create(ReadOnlySpan<MonetaryValue> values)
Parameters
Returns
Exceptions
Type |
Condition |
ArgumentException |
Attempted to add a value with a currency that is not available in the currency registry.
|
Create(CurrencyRegistry, ReadOnlySpan<MonetaryValue>)
Creates an immutable money bag that uses the specified currency registry and adds all the specified values.
Declaration
public static ImmutableMoneyBag Create(CurrencyRegistry registry, ReadOnlySpan<MonetaryValue> values)
Parameters
Returns
Exceptions
Type |
Condition |
ArgumentException |
Attempted to add a value with a currency that is not available in the currency registry.
|