コード例 #1
0
        public List <dynamic> ReadAsDynamic(string file)
        {
            var parser = new ExcelDataReaderToIParser(file, new ExcelDataOptions());

            using (var csv = new CsvReader(parser))
            {
                return(csv.GetRecords <dynamic>().ToList());
            }
        }
コード例 #2
0
        public List <dynamic> ReadAsExpandoObject(string file, ExpandoObject expando)
        {
            var parser = new ExcelDataReaderToIParser(file, new ExcelDataOptions());

            using (var csv = new CsvReader(parser))
            {
                foreach (var property in expando)
                {
                    Console.WriteLine(property.Key + ": " + property.Value);
                }

                return(csv.GetRecords <dynamic>(expando).ToList());
            }
        }