MiniExcel icon indicating copy to clipboard operation
MiniExcel copied to clipboard

对Query()的返回值类型有点疑问

Open CollapseNav opened this issue 2 years ago • 0 comments

Excel Type

  • [X] XLSX
  • [ ] XLSM
  • [ ] CSV
  • [ ] OTHER

Upload Excel File

CellRead.xlsx

MiniExcel Version

v1.30.2

Description

在 0.21.5版本中,使用如下代码可以正常转换

var data = _stream.Query() as IEnumerable<IDictionary<string, object>>;

但是在 1.30.2中不行,只能使用循环一个一个Add

List<IDictionary<string, object>> data = new();
foreach (var item in _stream.Query())
    data.Add(item as IDictionary<string, object>);

有没有办法可以简单使用 as 做转换

CollapseNav avatar Mar 24 '23 10:03 CollapseNav