Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

增加导入Stream时的回调委托参数 #536

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Magicodes.ExporterAndImporter.Core/IImporter.cs
Original file line number Diff line number Diff line change
@@ -74,6 +74,6 @@ public interface IImporter
/// <param name="stream"></param>
/// <param name="labelingFileStream"></param>
/// <returns></returns>
Task<ImportResult<T>> Import<T>(Stream stream,Stream labelingFileStream) where T : class, new();
Task<ImportResult<T>> Import<T>(Stream stream, Stream labelingFileStream, Func<ImportResult<T>, ImportResult<T>> importResultCallback = null) where T : class, new();
}
}
4 changes: 2 additions & 2 deletions src/Magicodes.ExporterAndImporter.Excel/ExcelImporter.cs
Original file line number Diff line number Diff line change
@@ -169,11 +169,11 @@ public class ExcelImporter : IExcelImporter
/// <param name="stream"></param>
/// <param name="labelingFileStream"></param>
/// <returns></returns>
public Task<ImportResult<T>> Import<T>(Stream stream, Stream labelingFileStream) where T : class, new()
public Task<ImportResult<T>> Import<T>(Stream stream, Stream labelingFileStream, Func<ImportResult<T>, ImportResult<T>> importResultCallback = null) where T : class, new()
{
using (var importer = new ImportHelper<T>(stream, labelingFileStream))
{
return importer.Import();
return importer.Import(importResultCallback: importResultCallback);
}
}