Ejemplo n.º 1
0
        public static IEnumerable <T> ReadCsv <T>(this ICakeContext context, FilePath csvFile, ClassMap classMap, CsvHelperSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            var csvHelpers = new CsvHelpers(context.FileSystem, context.Environment);

            return(csvHelpers.ReadRecords <T>(csvFile, classMap, settings));
        }
Ejemplo n.º 2
0
        public static void WriteCsv <T>(this ICakeContext context, FilePath csvFile, List <T> records, ClassMap classMap, CsvHelperSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            var csvHelpers = new CsvHelpers(context.FileSystem, context.Environment);

            csvHelpers.WriteRecords(csvFile, records, classMap, settings);
        }