public static Task <List <TRecord> > ReadRecordsAsync <TRecord, TRecordMap>(this ICsvReaderService csvReaderService, string fileName, ICsvContext csvContext = null) where TRecordMap : ClassMap, new() { Argument.IsNotNull(() => csvReaderService); if (csvContext == null) { csvContext = new CsvContext <TRecord, TRecordMap>(); } return(ReadRecordsAsync <TRecord>(csvReaderService, fileName, csvContext)); }
public static Task WriteRecordsAsync <TRecord, TRecordMap>(this ICsvWriterService csvWriterService, IEnumerable <TRecord> records, string fileName, ICsvContext csvContext = null) where TRecordMap : ClassMap, new() { Argument.IsNotNull(() => csvWriterService); if (csvContext == null) { csvContext = new CsvContext <TRecord, TRecordMap>(); } return(WriteRecordsAsync(csvWriterService, records, fileName, csvContext)); }
public static List <TRecord> ReadRecords <TRecord, TRecordMap>(this ICsvReaderService csvReaderService, StreamReader streamReader, ICsvContext csvContext = null) where TRecordMap : ClassMap, new() { Argument.IsNotNull(() => csvReaderService); if (csvContext == null) { csvContext = new CsvContext <TRecord, TRecordMap>(); } return(ReadRecords <TRecord>(csvReaderService, streamReader, csvContext)); }
public static void WriteRecords <TRecord, TRecordMap>(this ICsvWriterService csvWriterService, IEnumerable <TRecord> records, StreamWriter streamWriter, ICsvContext csvContext = null) where TRecordMap : ClassMap, new() { Argument.IsNotNull(() => csvWriterService); if (csvContext == null) { csvContext = new CsvContext <TRecord, TRecordMap>(); } csvWriterService.WriteRecords(records, streamWriter, csvContext); }