Method Create
Create()
Creates an empty immutable sorted money bag that uses the Default currency registry.
Declaration
public static ImmutableSortedMoneyBag Create()
Returns
Create(MonetaryValue)
Creates an empty immutable sorted money bag that uses the Default currency registry and contains the specified value.
Declaration
public static ImmutableSortedMoneyBag 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 sorted money bag that uses the specified currency registry.
Declaration
public static ImmutableSortedMoneyBag 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 sorted money bag that uses the specified currency registry and contains the specified value.
Declaration
public static ImmutableSortedMoneyBag 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 sorted money bag that uses the Default currency registry and adds all the specified values.
Declaration
public static ImmutableSortedMoneyBag 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 sorted money bag that uses the specified currency registry and adds all the specified values.
Declaration
public static ImmutableSortedMoneyBag 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 sorted money bag that uses the Default currency registry and adds all the specified values.
Declaration
public static ImmutableSortedMoneyBag 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 sorted money bag that uses the specified currency registry and adds all the specified values.
Declaration
public static ImmutableSortedMoneyBag 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.
|