@@ -105,31 +105,31 @@ public static async Task<int[]> SaveAsAsync(this Stream stream, object value, bo
105105 public static async IAsyncEnumerable < T > QueryAsync < T > ( string path , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , bool hasHeader = true , [ EnumeratorCancellation ] CancellationToken cancellationToken = default ) where T : class , new ( )
106106 {
107107 using ( var stream = FileHelper . OpenSharedRead ( path ) )
108- await foreach ( var item in QueryAsync < T > ( stream , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startCell , configuration , hasHeader , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
108+ await foreach ( var item in QueryAsync < T > ( stream , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startCell , configuration , hasHeader , cancellationToken ) . ConfigureAwait ( false ) )
109109 yield return item ; //Foreach yield return twice reason : https://stackoverflow.com/questions/66791982/ienumerable-extract-code-lazy-loading-show-stream-was-not-readable
110110 }
111111
112112 [ Zomp . SyncMethodGenerator . CreateSyncVersion ]
113113 public static async IAsyncEnumerable < T > QueryAsync < T > ( this Stream stream , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , bool hasHeader = true , [ EnumeratorCancellation ] CancellationToken cancellationToken = default ) where T : class , new ( )
114114 {
115115 using ( var excelReader = await ExcelReaderFactory . GetProviderAsync ( stream , ExcelTypeHelper . GetExcelType ( stream , excelType ) , configuration , cancellationToken ) . ConfigureAwait ( false ) )
116- await foreach ( var item in excelReader . QueryAsync < T > ( sheetName , startCell , hasHeader , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
116+ await foreach ( var item in excelReader . QueryAsync < T > ( sheetName , startCell , hasHeader , cancellationToken ) . ConfigureAwait ( false ) )
117117 yield return item ;
118118 }
119119
120120 [ Zomp . SyncMethodGenerator . CreateSyncVersion ]
121121 public static async IAsyncEnumerable < dynamic > QueryAsync ( string path , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
122122 {
123123 using ( var stream = FileHelper . OpenSharedRead ( path ) )
124- await foreach ( var item in QueryAsync ( stream , useHeaderRow , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startCell , configuration , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
124+ await foreach ( var item in QueryAsync ( stream , useHeaderRow , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startCell , configuration , cancellationToken ) . ConfigureAwait ( false ) )
125125 yield return item ;
126126 }
127127
128128 [ Zomp . SyncMethodGenerator . CreateSyncVersion ]
129129 public static async IAsyncEnumerable < dynamic > QueryAsync ( this Stream stream , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , IConfiguration configuration = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
130130 {
131131 using ( var excelReader = await ExcelReaderFactory . GetProviderAsync ( stream , ExcelTypeHelper . GetExcelType ( stream , excelType ) , configuration , cancellationToken ) . ConfigureAwait ( false ) )
132- await foreach ( var item in excelReader . QueryAsync ( useHeaderRow , sheetName , startCell , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
132+ await foreach ( var item in excelReader . QueryAsync ( useHeaderRow , sheetName , startCell , cancellationToken ) . ConfigureAwait ( false ) )
133133 yield return item . Aggregate ( new ExpandoObject ( ) as IDictionary < string , object > ,
134134 ( dict , p ) => { dict . Add ( p ) ; return dict ; } ) ;
135135 }
@@ -155,15 +155,15 @@ public static async IAsyncEnumerable<dynamic> QueryAsync(this Stream stream, boo
155155 public static async IAsyncEnumerable < dynamic > QueryRangeAsync ( string path , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , string endCell = "" , IConfiguration configuration = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
156156 {
157157 using ( var stream = FileHelper . OpenSharedRead ( path ) )
158- await foreach ( var item in QueryRangeAsync ( stream , useHeaderRow , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startCell , endCell , configuration , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
158+ await foreach ( var item in QueryRangeAsync ( stream , useHeaderRow , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startCell , endCell , configuration , cancellationToken ) . ConfigureAwait ( false ) )
159159 yield return item ;
160160 }
161161
162162 [ Zomp . SyncMethodGenerator . CreateSyncVersion ]
163163 public static async IAsyncEnumerable < dynamic > QueryRangeAsync ( this Stream stream , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , string startCell = "A1" , string endCell = "" , IConfiguration configuration = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
164164 {
165165 using ( var excelReader = await ExcelReaderFactory . GetProviderAsync ( stream , ExcelTypeHelper . GetExcelType ( stream , excelType ) , configuration , cancellationToken ) . ConfigureAwait ( false ) )
166- await foreach ( var item in excelReader . QueryRangeAsync ( useHeaderRow , sheetName , startCell , endCell , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
166+ await foreach ( var item in excelReader . QueryRangeAsync ( useHeaderRow , sheetName , startCell , endCell , cancellationToken ) . ConfigureAwait ( false ) )
167167 yield return item . Aggregate ( new ExpandoObject ( ) as IDictionary < string , object > ,
168168 ( dict , p ) => { dict . Add ( p ) ; return dict ; } ) ;
169169 }
@@ -172,15 +172,15 @@ public static async IAsyncEnumerable<dynamic> QueryRangeAsync(this Stream stream
172172 public static async IAsyncEnumerable < dynamic > QueryRangeAsync ( string path , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , int startRowIndex = 1 , int startColumnIndex = 1 , int ? endRowIndex = null , int ? endColumnIndex = null , IConfiguration configuration = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
173173 {
174174 using ( var stream = FileHelper . OpenSharedRead ( path ) )
175- await foreach ( var item in QueryRangeAsync ( stream , useHeaderRow , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startRowIndex , startColumnIndex , endRowIndex , endColumnIndex , configuration , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
175+ await foreach ( var item in QueryRangeAsync ( stream , useHeaderRow , sheetName , ExcelTypeHelper . GetExcelType ( path , excelType ) , startRowIndex , startColumnIndex , endRowIndex , endColumnIndex , configuration , cancellationToken ) . ConfigureAwait ( false ) )
176176 yield return item ;
177177 }
178178
179179 [ Zomp . SyncMethodGenerator . CreateSyncVersion ]
180180 public static async IAsyncEnumerable < dynamic > QueryRangeAsync ( this Stream stream , bool useHeaderRow = false , string sheetName = null , ExcelType excelType = ExcelType . UNKNOWN , int startRowIndex = 1 , int startColumnIndex = 1 , int ? endRowIndex = null , int ? endColumnIndex = null , IConfiguration configuration = null , [ EnumeratorCancellation ] CancellationToken cancellationToken = default )
181181 {
182182 using ( var excelReader = await ExcelReaderFactory . GetProviderAsync ( stream , ExcelTypeHelper . GetExcelType ( stream , excelType ) , configuration , cancellationToken ) . ConfigureAwait ( false ) )
183- await foreach ( var item in excelReader . QueryRangeAsync ( useHeaderRow , sheetName , startRowIndex , startColumnIndex , endRowIndex , endColumnIndex , cancellationToken ) . WithCancellation ( cancellationToken ) . ConfigureAwait ( false ) )
183+ await foreach ( var item in excelReader . QueryRangeAsync ( useHeaderRow , sheetName , startRowIndex , startColumnIndex , endRowIndex , endColumnIndex , cancellationToken ) . ConfigureAwait ( false ) )
184184 yield return item . Aggregate ( new ExpandoObject ( ) as IDictionary < string , object > ,
185185 ( dict , p ) => { dict . Add ( p ) ; return dict ; } ) ;
186186 }
0 commit comments