// First Installment always occurs on PaymentPlan creation date private void InitializeInstallments() { for (int interval = 0; interval < InstallmentCount; interval++) { Installments.Add(new Installment(OriginationDate.AddDays(interval * InstallmentIntervalDays), InstallmentAmount)); } Installments.OrderBy(i => i.Date); }
public Installment FirstInstallment() { if (!Installments.Any()) { throw new ApplicationException($"No Installments for Payment Plan Id {Id.ToString()}"); } return(Installments.OrderBy(i => i.Date).FirstOrDefault()); }