donnytian / Npoi.Mapper

Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multithreading error

hongwei7458 opened this issue · comments

commented

get data from other server whith parallel.ForEach, i have an error

code:
Parallel.ForEach(list, async item =>{
var temp= await getdata(item);
mapper.Put(temp, "sheet_"+item, false);
})

error:NPOI.POIXMLException

NullReferenceException: Object reference not set to an instance of an object.

sounds like an NPOI exception, I am not sure if NPOI supports multi-thread writing.