Currency Currency
Currency Currency
DocFX + Singulink = ♥

Search Results for

    Interface IImmutableMoneyBag

    Represents an immutable bag of monetary values in one or more currencies.

    Inherited Members
    ICollection<MonetaryValue>.Contains(MonetaryValue)
    ICollection<MonetaryValue>.CopyTo(MonetaryValue[], int)
    ICollection<MonetaryValue>.Remove(MonetaryValue)
    ICollection<MonetaryValue>.IsReadOnly
    IReadOnlyMoneyBag.this[string]
    IReadOnlyMoneyBag.this[Currency]
    IReadOnlyMoneyBag.Currencies
    IReadOnlyMoneyBag.IsSorted
    IReadOnlyMoneyBag.Registry
    IReadOnlyMoneyBag.Contains(decimal, Currency)
    IReadOnlyMoneyBag.Contains(decimal, string)
    IReadOnlyMoneyBag.ContainsCurrency(Currency)
    IReadOnlyMoneyBag.ContainsCurrency(string)
    IReadOnlyMoneyBag.TryGetAmount(Currency, out decimal)
    IReadOnlyMoneyBag.TryGetAmount(string, out decimal)
    IReadOnlyMoneyBag.TryGetValue(Currency, out MonetaryValue)
    IReadOnlyMoneyBag.TryGetValue(string, out MonetaryValue)
    IEnumerable<MonetaryValue>.GetEnumerator()
    IFormattable.ToString(string, IFormatProvider)
    Namespace: Singulink.Globalization
    Assembly: Singulink.Globalization.Currency.dll
    Syntax
    public interface IImmutableMoneyBag : ICollection<MonetaryValue>, IReadOnlyMoneyBag, IReadOnlyCollection<MonetaryValue>, IEnumerable<MonetaryValue>, IEnumerable, IFormattable

    Properties

    Name Description
    Count

    Gets the number of values in this bag.

    Methods

    Name Description
    Add(MonetaryValue)

    Adds the specified value to this bag and returns the resulting bag.

    Add(decimal, Currency)

    Adds the specified currency and amount to this bag and returns the resulting bag.

    Add(decimal, string)

    Adds the specified currency and amount to this bag and returns the resulting bag.

    AddRange(IEnumerable<MonetaryValue>)

    Adds the specified values to this bag and returns the resulting bag.

    Clear()

    Returns an empty immutable bag that has the same currency registry as this bag.

    Create(CurrencyRegistry, IEnumerable<MonetaryValue>)

    Creates a bag that uses the specified currency registry and adds all the specified values.

    Remove(Currency)

    Removes the value with the given currency and returns the resulting bag.

    Remove(string)

    Removes the value with the given currency code and returns the resulting bag.

    RemoveAll(IEnumerable<Currency>)

    Removes all the values from this bag that match the specified currencies and returns the resulting bag.

    RemoveAll(Func<MonetaryValue, bool>)

    Removes all the values from this bag that match the specified predicate and returns the resulting bag.

    RoundToCurrencyDigits()

    Rounds each value's amount to its currency's DecimalDigits using ToEven midpoint rounding (i.e. "banker's rounding") and returns the resulting bag.

    RoundToCurrencyDigits(MidpointRounding)

    Rounds each value's amount to its currency's DecimalDigits using the specified midpoint rounding mode and returns the resulting bag.

    SetAmount(decimal, Currency)

    Sets the amount the bag contains for the specified currency code and returns the resulting bag.

    SetAmount(decimal, string)

    Sets the amount the bag contains for the specified currency code and returns the resulting bag.

    SetValue(MonetaryValue)

    Sets the value this bag contains for the currency of the specified value and returns the resulting bag.

    Subtract(MonetaryValue)

    Subtracts the specified value from this bag and returns the resulting bag. Zero amounts are not trimmed from the bag.

    Subtract(decimal, Currency)

    Adds the specified currency and amount to this bag and returns the resulting bag.

    Subtract(decimal, string)

    Subtracts the specified currency and amount from this bag and returns the resulting bag.

    SubtractRange(IEnumerable<MonetaryValue>)

    Subtracts the specified values from this bag and returns the resulting bag. Zero amounts are not trimmed from the bag.

    TransformAmounts(Func<decimal, decimal>)

    Applies the specified transformation to each value's amount in this bag and returns the resulting bag.

    TransformAmounts(Func<decimal, decimal?>)

    Applies the specified transformation to each value's amount in this bag and returns the resulting bag. Amounts transformed to a null amount are removed.

    TransformValues(Func<MonetaryValue, decimal>)

    Applies the specified transformation to each value's amount in this bag and returns the resulting bag.

    TransformValues(Func<MonetaryValue, decimal?>)

    Applies the specified transformation to each value's amount in this bag and returns the resulting bag. Values transformed to a null amount are removed.

    TrimZeroAmounts()

    Removes all zero amounts from this bag and returns the resulting bag.

    Extension Methods

    MoneyCollectionExtensions.ToImmutableMoneyBag(IReadOnlyMoneyBag)
    MoneyCollectionExtensions.ToImmutableMoneyBag(IReadOnlyMoneyBag, CurrencyRegistry)
    MoneyCollectionExtensions.ToImmutableSortedMoneyBag(IReadOnlyMoneyBag)
    MoneyCollectionExtensions.ToImmutableSortedMoneyBag(IReadOnlyMoneyBag, CurrencyRegistry)
    MoneyCollectionExtensions.ToMoneyBag(IReadOnlyMoneyBag)
    MoneyCollectionExtensions.ToMoneyBag(IReadOnlyMoneyBag, CurrencyRegistry)
    MoneyCollectionExtensions.ToSortedMoneyBag(IReadOnlyMoneyBag)
    MoneyCollectionExtensions.ToSortedMoneyBag(IReadOnlyMoneyBag, CurrencyRegistry)
    MoneyCollectionExtensions.ToImmutableMoneyBag(IEnumerable<MonetaryValue>, CurrencyRegistry)
    MoneyCollectionExtensions.ToImmutableSortedMoneyBag(IEnumerable<MonetaryValue>, CurrencyRegistry)
    MoneyCollectionExtensions.ToMoneyBag(IEnumerable<MonetaryValue>, CurrencyRegistry)
    MoneyCollectionExtensions.ToSortedMoneyBag(IEnumerable<MonetaryValue>, CurrencyRegistry)
    © Singulink. All rights reserved.