File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
FileContextCore/StoreManager Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11using Example . Data . Entities ;
22using FileContextCore ;
3+ using FileContextCore . StoreManager ;
34using Microsoft . EntityFrameworkCore ;
5+ using OfficeOpenXml ;
46
57namespace Example . Data
68{
@@ -41,6 +43,7 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
4143 // optionsBuilder.UseFileContextDatabase(location: @"D:\t");
4244
4345 //Excel
46+ // ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
4447 // optionsBuilder.UseFileContextDatabase<EXCELStoreManager>(databaseName: "test");
4548 }
4649
Original file line number Diff line number Diff line change 11using Microsoft . EntityFrameworkCore ;
22using Example . Data . Entities ;
33using FileContextCore ;
4+ using FileContextCore . StoreManager ;
5+ using OfficeOpenXml ;
46
57namespace Example . Data
68{
@@ -35,7 +37,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
3537 //optionsBuilder.UseFileContext("csv");
3638
3739 //Excel
38- //optionsBuilder.UseFileContext("excel");
40+ // ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
41+ // optionsBuilder.UseFileContextDatabase<EXCELStoreManager>(databaseName: "excel");
3942 }
4043
4144 protected override void OnModelCreating ( ModelBuilder modelBuilder )
Original file line number Diff line number Diff line change @@ -173,7 +173,10 @@ private void DeleteUnusedRows(int lastRow)
173173 if ( _worksheet . Dimension . Rows >= lastRow )
174174 {
175175 int count = _worksheet . Dimension . Rows - lastRow ;
176- _worksheet . DeleteRow ( lastRow + 1 , count ) ;
176+ if ( count > 0 )
177+ {
178+ _worksheet . DeleteRow ( lastRow + 1 , count ) ;
179+ }
177180 }
178181 }
179182 }
You can’t perform that action at this time.
0 commit comments