public Lease(DateTime start, DateTime end, double rent) { LeaseStart = new DateTime(start.Year, start.Month, 1); LeaseEnd = end; InitialRent = rent; leaseCF = new Cashflows(); computeCF(); ExitRent = leaseCF.getLast(); }
public static Cashflows operator+(Cashflows firstCF, Cashflows secondCF) { Cashflows sum = new Cashflows(); sum.cf = firstCF.cf; foreach (var item in secondCF.cf) { if (firstCF.cf.ContainsKey(item.Key)) { sum.cf[item.Key] += item.Value; } else { sum.cf.Add(item.Key, item.Value); } } return(sum); }