Example #1
0
        public void WriteToBirthdayCsvFile(BirthdayPerson birthdayPerson)
        {
            var currentRecords = csvReaderWrapper.ReadFromBirthDayCsvFile();

            currentRecords.Add(birthdayPerson);

            using (var stream = new StreamWriter(configurationWrapper.GetBirthdayCsvFilePath()))
                using (var writer = new CsvWriter(stream, new CultureInfo("EN")))
                {
                    writer.Configuration.HasHeaderRecord = true;
                    writer.WriteRecords(currentRecords);
                }
        }