i want to copy the data of an uploaded file to an IList object. The uploaded file is .csv-data.
My code looks like this:
public void FileToIList(IFormFile importFile)
{
if (importFile != null)
{
//var path = Path.Combine(wwwrootDiectory, DateTime.Now.Ticks.ToString() + Path.GetExtension(importFile.FileName));
//IList<string> = importFile.OpenReadStream().Read() <= does not work
}
But I don't want to save the content of the importFile in a temporary data. I want to write the content in directly way into a IList object. Is it possible?
After this lines I don't know further. Do you have a solution or maybe a idea?