@@ -52,7 +52,7 @@ public static async Task<int>InsertAsync(this Stream stream, object value, strin
5252 }
5353 }
5454
55- public static async Task < int [ ] > SaveAsAsync ( string path , object value , bool printHeader = true , string sheetName = "Sheet1" , ExcelType excelType = ExcelType . UNKNOWN , IConfiguration configuration = null , bool overwriteFile = false , CancellationToken cancellationToken = default ( CancellationToken ) )
55+ public static async Task < int [ ] > SaveAsAsync ( string path , object value , bool printHeader = true , string sheetName = "Sheet1" , ExcelType excelType = ExcelType . UNKNOWN , IConfiguration configuration = null , bool overwriteFile = false , CancellationToken cancellationToken = default )
5656 {
5757 if ( Path . GetExtension ( path ) . ToLowerInvariant ( ) == ".xlsm" )
5858 throw new NotSupportedException ( "MiniExcel's SaveAs does not support the .xlsm format" ) ;
@@ -61,42 +61,42 @@ public static async Task<int>InsertAsync(this Stream stream, object value, strin
6161 return await SaveAsAsync ( stream , value , printHeader , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , configuration , cancellationToken ) ;
6262 }
6363
64- public static async Task < int [ ] > SaveAsAsync ( this Stream stream , object value , bool printHeader = true , string sheetName = "Sheet1" , ExcelType excelType = ExcelType . XLSX , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
64+ public static async Task < int [ ] > SaveAsAsync ( this Stream stream , object value , bool printHeader = true , string sheetName = "Sheet1" , ExcelType excelType = ExcelType . XLSX , IConfiguration configuration = null , CancellationToken cancellationToken = default )
6565 {
6666 return await ExcelWriterFactory . GetProvider ( stream , value , sheetName , excelType , configuration , printHeader ) . SaveAsAsync ( cancellationToken ) ;
6767 }
6868
69- public static async Task MergeSameCellsAsync ( string mergedFilePath , string path , ExcelType excelType = ExcelType . UNKNOWN , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
69+ public static async Task MergeSameCellsAsync ( string mergedFilePath , string path , ExcelType excelType = ExcelType . UNKNOWN , IConfiguration configuration = null , CancellationToken cancellationToken = default )
7070 {
7171 await Task . Run ( ( ) => MergeSameCells ( mergedFilePath , path , excelType , configuration ) , cancellationToken ) . ConfigureAwait ( false ) ;
7272 }
7373
74- public static async Task MergeSameCellsAsync ( this Stream stream , string path , ExcelType excelType = ExcelType . XLSX , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
74+ public static async Task MergeSameCellsAsync ( this Stream stream , string path , ExcelType excelType = ExcelType . XLSX , IConfiguration configuration = null , CancellationToken cancellationToken = default )
7575 {
7676 await ExcelTemplateFactory . GetProvider ( stream , configuration , excelType ) . MergeSameCellsAsync ( path , cancellationToken ) ;
7777 }
7878
79- public static async Task MergeSameCellsAsync ( this Stream stream , byte [ ] fileBytes , ExcelType excelType = ExcelType . XLSX , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
79+ public static async Task MergeSameCellsAsync ( this Stream stream , byte [ ] fileBytes , ExcelType excelType = ExcelType . XLSX , IConfiguration configuration = null , CancellationToken cancellationToken = default )
8080 {
8181 await ExcelTemplateFactory . GetProvider ( stream , configuration , excelType ) . MergeSameCellsAsync ( fileBytes , cancellationToken ) ;
8282 }
8383
84- public static async Task < IEnumerable < dynamic > > QueryAsync ( string path , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
84+ public static async Task < IEnumerable < dynamic > > QueryAsync ( string path , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default )
8585 {
8686 return await Task . Run ( ( ) => Query ( path , useHeaderRow , sheetName , excelType , startCell , configuration ) , cancellationToken ) ;
8787 }
8888
89- public static async Task < IEnumerable < T > > QueryAsync < T > ( this Stream stream , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) ) where T : class , new ( )
89+ public static async Task < IEnumerable < T > > QueryAsync < T > ( this Stream stream , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default , bool hasHeader = true ) where T : class , new ( )
9090 {
91- return await ExcelReaderFactory . GetProvider ( stream , ExcelTypeHelper . GetExcelType ( stream , excelType ) , configuration ) . QueryAsync < T > ( sheetName , startCell , cancellationToken ) . ConfigureAwait ( false ) ;
91+ return await ExcelReaderFactory . GetProvider ( stream , ExcelTypeHelper . GetExcelType ( stream , excelType ) , configuration ) . QueryAsync < T > ( sheetName , startCell , hasHeader , cancellationToken ) . ConfigureAwait ( false ) ;
9292 }
9393
94- public static async Task < IEnumerable < T > > QueryAsync < T > ( string path , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) ) where T : class , new ( )
94+ public static async Task < IEnumerable < T > > QueryAsync < T > ( string path , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default , bool hasHeader = true ) where T : class , new ( )
9595 {
96- return await Task . Run ( ( ) => Query < T > ( path , sheetName , excelType , startCell , configuration ) , cancellationToken ) . ConfigureAwait ( false ) ;
96+ return await Task . Run ( ( ) => Query < T > ( path , sheetName , excelType , startCell , configuration , hasHeader ) , cancellationToken ) . ConfigureAwait ( false ) ;
9797 }
9898
99- public static async Task < IEnumerable < dynamic > > QueryAsync ( this Stream stream , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
99+ public static async Task < IEnumerable < dynamic > > QueryAsync ( this Stream stream , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default )
100100 {
101101 var tcs = new TaskCompletionSource < IEnumerable < dynamic > > ( ) ;
102102 cancellationToken . Register ( ( ) =>
@@ -119,22 +119,22 @@ await Task.Run(() =>
119119 return await tcs . Task ;
120120
121121 }
122- public static async Task SaveAsByTemplateAsync ( this Stream stream , string templatePath , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
122+ public static async Task SaveAsByTemplateAsync ( this Stream stream , string templatePath , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default )
123123 {
124124 await ExcelTemplateFactory . GetProvider ( stream , configuration ) . SaveAsByTemplateAsync ( templatePath , value , cancellationToken ) . ConfigureAwait ( false ) ;
125125 }
126126
127- public static async Task SaveAsByTemplateAsync ( this Stream stream , byte [ ] templateBytes , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
127+ public static async Task SaveAsByTemplateAsync ( this Stream stream , byte [ ] templateBytes , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default )
128128 {
129129 await ExcelTemplateFactory . GetProvider ( stream , configuration ) . SaveAsByTemplateAsync ( templateBytes , value , cancellationToken ) . ConfigureAwait ( false ) ;
130130 }
131131
132- public static async Task SaveAsByTemplateAsync ( string path , string templatePath , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
132+ public static async Task SaveAsByTemplateAsync ( string path , string templatePath , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default )
133133 {
134134 await Task . Run ( ( ) => SaveAsByTemplate ( path , templatePath , value , configuration ) , cancellationToken ) . ConfigureAwait ( false ) ;
135135 }
136136
137- public static async Task SaveAsByTemplateAsync ( string path , byte [ ] templateBytes , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
137+ public static async Task SaveAsByTemplateAsync ( string path , byte [ ] templateBytes , object value , IConfiguration configuration = null , CancellationToken cancellationToken = default )
138138 {
139139 await Task . Run ( ( ) => SaveAsByTemplate ( path , templateBytes , value , configuration ) , cancellationToken ) . ConfigureAwait ( false ) ;
140140 }
@@ -143,7 +143,7 @@ await Task.Run(() =>
143143 /// QueryAsDataTable is not recommended, because it'll load all data into memory.
144144 /// </summary>
145145 [ Obsolete ( "QueryAsDataTable is not recommended, because it'll load all data into memory." ) ]
146- public static async Task < DataTable > QueryAsDataTableAsync ( string path , bool useHeaderRow = true , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
146+ public static async Task < DataTable > QueryAsDataTableAsync ( string path , bool useHeaderRow = true , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default )
147147 {
148148 return await Task . Run ( ( ) => QueryAsDataTable ( path , useHeaderRow , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startCell , configuration ) , cancellationToken ) . ConfigureAwait ( false ) ;
149149 }
@@ -152,7 +152,7 @@ await Task.Run(() =>
152152 /// QueryAsDataTable is not recommended, because it'll load all data into memory.
153153 /// </summary>
154154 [ Obsolete ( "QueryAsDataTable is not recommended, because it'll load all data into memory." ) ]
155- public static async Task < DataTable > QueryAsDataTableAsync ( this Stream stream , bool useHeaderRow = true , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default ( CancellationToken ) )
155+ public static async Task < DataTable > QueryAsDataTableAsync ( this Stream stream , bool useHeaderRow = true , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , CancellationToken cancellationToken = default )
156156 {
157157 return await Task . Run ( ( ) => QueryAsDataTable ( stream , useHeaderRow , sheetName , excelType , startCell , configuration ) , cancellationToken ) . ConfigureAwait ( false ) ;
158158 }
0 commit comments