csvtools

Exporting data to CSV from Controller

梦想的初衷 提交于 2019-12-08 07:58:02
问题 I'm using the CsvHelper library in an ASP.NET MVC project to export data to CSV, and am finding that the exported data is either cut off, or in the case of smaller lists, no data is being written at all, and I'm receiving a blank CSV file. My base controller has a method like this (which is called by controllers inheriting from this class to export lists of entities): protected FileContentResult GetExportFileContentResult(IList data, string filename) { using (var memoryStream = new