ソースを参照

Added constructor

Piotr Czajkowski 3 ヶ月 前
コミット
c2dc285e33
1 ファイル変更5 行追加0 行削除
  1. 5 0
      ExcelORM/ExcelORM/ExcelWriter.cs

+ 5 - 0
ExcelORM/ExcelORM/ExcelWriter.cs

@@ -14,6 +14,11 @@ public class ExcelWriter
         xlWorkbook = File.Exists(path) ? new XLWorkbook(path) : new XLWorkbook();
     }
 
+    public ExcelWriter(IXLWorkbook workbook)
+    {
+        xlWorkbook = workbook ?? throw new ArgumentNullException(nameof(workbook));
+    }
+
     private static int GenerateHeader<T>(IXLWorksheet worksheet, PropertyInfo[] properties) where T : class
     {
         var rowIndex = 1;