Generalize excel writing with a common write adapter and implement writing IAsyncEnumerable - #712
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
@Discolai I change some of the code, so that there are no more break change
@shps951023 Can we mark |
I realized the same as you did for |
Ha ~, |
Yes I agree that we can remove/deprecate |
Couldn't agree more, current work loading is hard between async and non-async. |
@izanhzh Some people would like to use higher source to get better performance, for me, I only use ZipArchiveMode.Create by miniexcel. we can develop miniexcel new functions only for ZipArchiveMode.Create. Becuase ZipArchiveMode.Update is not the core of miniexcel :) . |
…iting IAsyncEnumerable (mini-software#712) * Generalize excel writing with a common write adapter * Remove testcase for single row in empty table * Implement sync IExcelWriteAdapter * Remove testcase for single row in empty table * Add back support for writing IMiniExcelDataReader * Add support for writing AsyncEnumerable * Add cancellation support * Add MiniExcelWriteAdapterFactory * Implement write adapters for csv writing * cancel break change * fix build bug * fix get props bug * cancel some adjust * clean code --------- Co-authored-by: izanhzh <hzh990094740@outlook.com>


I have done some work previously with the writing logic in MiniExcel and I always found it cumbersome to duplicate it across different datasource implementations .
This PR adds two new interfaces
IMiniExcelWriteAdapterandIAsyncMiniExcelWriteAdapterto generalize data fetching for writing to excel or csv. Which makes is much easier to add support for new datasources as well as adding new functionality or fixing bugs.I also added support for writing
IAsyncEnumerableto both excel and csv.#706 added support for writing asynchronously with the
IMiniExcelDataReader. I moved this implementation intoMiniExcelDataReaderWriteAdapterwhich usesIAsyncEnumerableinternally. This makes it incompatible with dotnet 4.5. @izanhzhAnother change which might be breaking is that writing an empty collection will no longer produce 1 row, but 0.