Esempio n. 1
0
 public override int GetHashCode()
 {
     unchecked {
         const int randomPrime = 397;
         int       hashCode    = Id.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ DocumentId.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ BuyerId.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ PurchasedAt.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (TransactionId != null ? TransactionId.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 2
0
        public IEnumerable <decimal> GetMaintenancePayments(DateTime at)
        {
            at = new DateTime(at.Year, at.Month, at.Day);

            if (at <= PurchasedAt)
            {
                yield break;
            }

            for (var i = 0; i < at.SubtractMonths(PurchasedAt); i += 1)
            {
                yield return(Inflations.ConsumerPriceIndex
                             .GetValueAt(
                                 MonthlyMaintenanceFees,
                                 PurchasedAt,
                                 PurchasedAt.AddMonths(i)
                                 ));
            }
        }