Ejemplo n.º 1
0
		} // ToString

		/// <summary>
		/// Creates a deep copy of current model.
		/// </summary>
		/// <returns>A copy of current model.</returns>
		public LoanCalculatorModel DeepClone() {
			var lcm = new LoanCalculatorModel {
				InterestOnlyRepayments = InterestOnlyRepayments,
			};

			lcm.DiscountPlan.AddRange(DiscountPlan);
			lcm.Repayments.AddRange(Repayments.Select(v => v.DeepClone()));
			lcm.Fees.AddRange(Fees.Select(v => v.DeepClone()));
			lcm.BadPeriods.AddRange(BadPeriods.Select(v => v.DeepClone()));

			lcm.LoanHistory.Clear();
			lcm.LoanHistory.AddRange(LoanHistory.Select(v => v.DeepClone()));

			return lcm;
		} // DeepClone