public void SetFeeSchedule(FeeSchedule feeSchedule) { if (feeSchedule == null) { throw new ArgumentNullException(nameof(feeSchedule)); } var existingSchedule = FeeSchedules.FirstOrDefault(a => a.Product.ProductCode == feeSchedule.Product.ProductCode); if (existingSchedule != null) { FeeSchedules.Remove(existingSchedule); } FeeSchedules.Add(feeSchedule); }
private void SetFeeSchedule(FeeScheduleViewModel feeScheduleData) { if (feeScheduleData == null) { throw new ArgumentNullException(nameof(feeScheduleData)); } var existingSchedule = FeeSchedules.FirstOrDefault(a => a.Product.ProductCode == feeScheduleData.Product.ProductCode); if (existingSchedule != null) { FeeSchedules.Remove(existingSchedule); } FeeSchedules.Add(feeScheduleData); }