private static void CurrencyCheck(Money left, Money right) { if (left.Currency != right.Currency) { throw new ArithmeticException("Unable to perform arithmetic operations on Money values of different Currency."); } }
public bool Equals(Money other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.Amount == Amount && Equals(other.Currency, Currency); }