0

I am unit testing a new API. I need to write a test method to call a method that converts excel to datatable using ExcelDataReader.DataSet.

The ExcelDataReader library documentation doesn't indicate that there is any method to go form a dataset to an excel file with it. The REST method in the controller for the API takes in the file as an IFormFile. So I need to go from DataTable/DataSet to an IFormFile that can be identified as an xlsx.

How do you go from DataTable to IFormfile(Excel) in .net core?

davidp04
  • 33
  • 1
  • 10
  • I can suggest you to use an Excel creator package like [Aspose.Cells](https://products.aspose.com/cells/net) -HTH ;). – shA.t Aug 26 '18 at 10:30
  • Is this saying to use it instead of IFormFile? That's how the page reads. That may work if it can take input from javascript (I'm sending an object in the body of an ajax call) but I see nothing indicating that. – davidp04 Aug 27 '18 at 14:19

0 Answers0