Interface IExcelService
Interface for a service that provides methods for working with Excel files.
Namespace: DataWeb.Data.Exchange
Assembly: DataWeb.Core.dll
Syntax
public interface IExcelService
Methods
DictionaryListToStreamAsync(IEnumerable<Dictionary<string, object>>, string, CancellationToken)
Converts a list of dictionaries to an Excel file and returns it as a stream.
Declaration
Task<Stream> DictionaryListToStreamAsync(IEnumerable<Dictionary<string, object>> dictionaryList, string dataName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Dictionary<string, object>> | dictionaryList | The list of dictionaries to convert to an Excel file. |
string | dataName | The name of the data to include in the Excel file. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Stream> | A stream that contains the Excel file. |
ListToStreamAsync(IEnumerable, string, CancellationToken)
Converts a list of objects to an Excel file and returns it as a stream.
Declaration
Task<Stream> ListToStreamAsync(IEnumerable list, string dataName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | list | The list of objects to convert to an Excel file. |
string | dataName | The name of the data to include in the Excel file. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Stream> | A stream that contains the Excel file. |
StreamToExcelDataAsync(Stream, CancellationToken)
Reads an Excel file from a stream and returns its data.
Declaration
Task<ExcelData> StreamToExcelDataAsync(Stream stream, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to read the Excel file from. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ExcelData> | An ExcelData object that contains the data extracted from the Excel file. |