소스 검색

We need constant number of columns, even if empty

Piotr Czajkowski 3 달 전
부모
커밋
64ffc60617
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      ExcelORM/ExcelORM/ExcelDynamicReader.cs

+ 5 - 1
ExcelORM/ExcelORM/ExcelDynamicReader.cs

@@ -24,7 +24,11 @@ public class ExcelDynamicReader
             foreach (var item in mapping)
             {
                 var cell = row.Cell(item.Position);
-                if (cell == null || cell.Value.IsBlank) continue;
+                if (cell == null || cell.Value.IsBlank)
+                {
+                    dynamicRow.Add(item);
+                    continue;
+                }
 
                 if (item.Type == null) item.Type = cell.Value.ValueType();