public void Fluent()
        {
            var tr = TestData.GetTextReader();

            var    splitter = new global::FluentCsv.CsvParser.Splitters.Rfc4180DataSplitter();
            string line;

            while ((line = tr.ReadLine()) != null)
            {
                var row = splitter.SplitColumns(line, ",");
            }
        }
Exemple #2
0
        public List <T> GetRecords <T>(MemoryStream stream) where T : ICsvReadable, new()
        {
            var activate   = ActivatorFactory.Create <T>(_activationMethod);
            var allRecords = new List <T>();

            using (var reader = new StreamReader(stream))
            {
                var    splitter = new global::FluentCsv.CsvParser.Splitters.Rfc4180DataSplitter();
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    var row    = splitter.SplitColumns(line, ",");
                    var record = activate();
                    record.Read(i => row[i]);
                    allRecords.Add(record);
                }
            }

            return(allRecords);
        }