Mapper.Take<T>() works wrong sometimes when cell is numeric as text maps to string property
xjfnet opened this issue · comments
xjfnet commented
sorry for my broken english
column header name is: NF
cell format is text
cell value is 2017
public class Entity
{
...
public string NF { get; set; }
...
}
var set = mapper.Take<Entity>();
var isnull = set.All(x => x.NF == null);
isnull is true
but this works well
Mapper.Take<dynamic>()
Donny Tian commented
First make sure there is a column named "NF" in the first Excel row. then
- Try set[0].Value.NF property
- Otherwise try define NF as int type. In Excel, that column might be formatted as numbers automatically. Or you can manually set as text format in Excel.
xjfnet commented
sorry, this is my mistake
i have two xlsx, and they has some column with the same name
i read the wrong xlsx file....
please remove this issue