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;