JoshClose / CsvHelper

Library to help reading and writing CSV files
http://joshclose.github.io/CsvHelper/
Other
4.71k stars 1.06k forks source link

IAsyncEnumerable doesnot contain the defination for ToListAsync #1983

Open avichhetri8 opened 2 years ago

avichhetri8 commented 2 years ago

I am trying to read the csv file using the GetRecordsAsync method with ToListAsync

got error AsyncEnumerable doesnot contain the defination for ToListAsync

           using (var reader = new StreamReader(a, Encoding.UTF8))
            using (var csv = new CsvReader(reader, new CsvConfiguration(CultureInfo.InvariantCulture)
            {
                HasHeaderRecord = false
            }))
            {
                await csv.GetRecordsAsync<FileGenerator>().ToListAsync();
            }
JoshClose commented 2 years ago

Try this package. https://www.nuget.org/packages/System.Linq.Async