ExcelReadHelperProcessLargeExcelStreamingGenericAsyncT 方法

异步流式处理大型 Excel/CSV - 支持自定义 POCO 转换

Definition

命名空间: Suresking.Utility
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
C#
public static Task<int> ProcessLargeExcelStreamingGenericAsync<T>(
	string filePath,
	int headerRows,
	Func<Dictionary<string, string>, T> rowConverter,
	Func<List<T>, Task> rowProcessor,
	int batchSize = 1000,
	IProgress<int>? progress = null,
	CancellationToken cancellationToken = default
)

参数

filePath  String

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <param name="filePath"/> 文档]

headerRows  Int32

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <param name="headerRows"/> 文档]

rowConverter  FuncDictionaryString, String, T

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <param name="rowConverter"/> 文档]

rowProcessor  FuncListT, Task

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <param name="rowProcessor"/> 文档]

batchSize  Int32  (Optional)

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <param name="batchSize"/> 文档]

progress  IProgressInt32  (Optional)

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <param name="progress"/> 文档]

cancellationToken  CancellationToken  (Optional)

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <param name="cancellationToken"/> 文档]

类型参数

T

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <typeparam name="T"/> 文档]

返回值

TaskInt32

[缺少 "M:Suresking.Utility.ExcelReadHelper.ProcessLargeExcelStreamingGenericAsync``1(System.String,System.Int32,System.Func{System.Collections.Generic.Dictionary{System.String,System.String},``0},System.Func{System.Collections.Generic.List{``0},System.Threading.Tasks.Task},System.Int32,System.IProgress{System.Int32},System.Threading.CancellationToken)" 的 <returns> 文档]

参见