Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ignatandrei/RSCG_WebAPIExports
Add exports to file to WebAPI ( for the moment, just Excel / xlsx)
https://github.com/ignatandrei/RSCG_WebAPIExports
Last synced: 2 days ago
JSON representation
Add exports to file to WebAPI ( for the moment, just Excel / xlsx)
- Host: GitHub
- URL: https://github.com/ignatandrei/RSCG_WebAPIExports
- Owner: ignatandrei
- License: mit
- Created: 2023-08-15T15:48:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-16T16:58:11.000Z (about 1 year ago)
- Last Synced: 2024-05-22T04:33:05.031Z (6 months ago)
- Language: C#
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- RSCG_Examples - https://github.com/ignatandrei/RSCG_WebAPIExports/
README
[![RSCG_WebAPIExports](https://img.shields.io/nuget/v/RSCG_WebAPIExports?label=RSCG_WebAPIExports)](https://www.nuget.org/packages/RSCG_WebAPIExports/)
# RSCG_WebAPIExports
Add exports to file to WebAPI ( for the moment, just Excel / xlsx)
## How to use in WebAPI project
Add reference to the package in the .csproj
```xml```
or
```xml```
Then in the WebAPI add
```csharp
using WebApiExportToFile;
//code
// Add services to the container.
//WebApiExportToFile.AddExport(builder.Services);
builder.Services.AddExport();
var app = builder.Build();
app.UseExport();```
Add to any url : .xlsx ( e.g.
for /WeatherForecast put /WeatherForecast.xlsx
for /WeatherForecast/GetPerson?id=23 put /WeatherForecast/GetPerson.xlsx?id=23
)
and the excel will be downloaded
## Examples
JSON value type array:
https://tiltwebapp.azurewebsites.net/api/PublicTILTs/PublicTiltsURLExcel:
https://tiltwebapp.azurewebsites.net/api/PublicTILTs/PublicTiltsURL.xlsxJSON object array:
https://tiltwebapp.azurewebsites.net/api/PublicTILTs/LatestTILTs/ignatandrei/10Excel:
https://tiltwebapp.azurewebsites.net/api/PublicTILTs/LatestTILTs/ignatandrei/10.xlsx