ClosedXML / ClosedXML/ClosedXML.Extensions.WebApi
Async code example in Readme
- Dominant language
- C#
- Stars
- 35
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
```
private async Task BuildExcelFile(int id)
{
//Creating the workbook
var t = Task.Run(() =>
{
var wb = new XLWorkbook();
var ws = wb.AddWorksheet("Sheet1");
ws.FirstCell().SetValue(id);
return wb;
});
return await t;
}
```
instead of
```
private Task BuildExcelFile(int id)
{
//Creating the workbook
return Task.Run(() =>
{
var wb = new XLWorkbook();
var ws = wb.AddWorksheet("Sheet1");
ws.FirstCell().SetValue(id);
return wb;
});
}
```
and could be even
```
private XLWorkbook BuildExcelFile(int id)
{
//Creating the workbook
var wb = new XLWorkbook();
var ws = wb.AddWorksheet("Sheet1");
ws.FirstCell().SetValue(id);
return wb;
}
```
(and then Task.Run(...) in the main function)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.