예제 #1
0
        public static IConvertedCurrency operator -(ConvertedCurrency currency, IConvertedCurrency substractingCurrency)
        {
            if (currency.Currency.Equals(substractingCurrency.Currency))
            {
                currency.Amount -= substractingCurrency.Amount;
                return(currency);
            }

            ConvertedCurrency convertedCurrency = (ConvertedCurrency)currency.money.From(substractingCurrency.Currency, substractingCurrency.Amount).To(currency.Currency).GetAwaiter().GetResult();

            return(currency - convertedCurrency);
        }
예제 #2
0
        public static IConvertedCurrency operator +(ConvertedCurrency currency, IConvertedCurrency addingCurrency)
        {
            if (currency.Currency.Equals(addingCurrency.Currency))
            {
                currency.Amount += addingCurrency.Amount;
                return(currency);
            }

            ConvertedCurrency convertedCurrency = (ConvertedCurrency)currency.money.From(addingCurrency.Currency, addingCurrency.Amount).To(currency.Currency).GetAwaiter().GetResult();

            return(currency + convertedCurrency);
        }