/// <summary> /// Loads from CSV. /// </summary> /// <param name="stream">The stream.</param> public void LoadFromCsv(StreamReader stream) { FileCabinetRecordCsvReader csvReader = new FileCabinetRecordCsvReader(stream); this.Records = new ReadOnlyCollection <FileCabinetRecord>(csvReader.ReadAll()); }
/// <summary> /// Loads from CSV. /// </summary> /// <param name="reader">The reader.</param> /// <param name="validator">The validator.</param> /// <param name="converter">The converter.</param> /// <param name="modelWriter">console writer.</param> public void LoadFromCsv(StreamReader reader, IRecordValidator validator, Converter converter, ModelWriters modelWriter) { FileCabinetRecordCsvReader csvReader = new FileCabinetRecordCsvReader(reader, validator, converter, modelWriter); this.ReadRecords = csvReader.ReadAll(); }