public void Test_Excel_FileImport() { using (FileStream fileStream = new FileStream("C:\\Tests\\test.xlsx", FileMode.Open)) { IFileImporter <DataTable> importer = new ExcelDataTableFileImporter(); var dt = new DataTable(); importer.Import(dt, fileStream); } }
public IEnumerable <IModel> Import(int type, Stream stream) { IFileImporter <DataTable> importer = new ExcelDataTableFileImporter(); var dt = new DataTable(); importer.Import(dt, stream); if (dt != null) { var items = ModelBuilder.Build((ModelType)type, dt, _context); return(items); } return(null); }