excel-mapper
excel-mapper copied to clipboard
Performance: Read cells from the data reader with the property type
IExcelDataReader supports reading values with the desired type. This can improve performance for boolean, numeric and date cells. A numeric cell in Excel is stored as a number, and can be read directly as number with, for example, reader.GetDecimal(). A DateTime cell in Excel is stored as a number, and can be read directly as DateTime with reader.GetDateTime(). But Excel Mapper always reads cell values as string. This "stringly-typed" aproach requires to format the value to string, and then parse the string to the property type, degrading performance. I suggest to read values from the data reader with the property type.