I want to add Excel and PDF generator in my new Solution in dotnet core 6. I following this template: https://github.com/iammukeshm/CleanArchitecture.WebApi
or
it really good clean architecture tutorial for dotnet core. In my understading, Excel Generator or PDF Generator will placed in Application/Features
For Example to download Invoice Report in Excel File, so the path will be
Solution
|- Application
|- Features
|- InvoiceFeature
|- Commands
|- Queries
|- Generates
|- GenerateInvoiceByDateRangeInExcel.cs
and in controllers
I will add
[HttpPost]
public async Task<IActionResult> DownloadExcel(GenerateInvoiceByDateRangeInExcel command)
{
return File(await Mediator.Send(command));
}
Honestly I dont try this idea first, so back to my question
Where I should put Excel/PDF generator class or function in Onion/Clean Architecture? and how to use it properly using Mediatr