update to .NET 6.0

This commit is contained in:
Kham
2022-12-02 15:53:33 +11:00
parent b32d02b001
commit 93fa738d72
12 changed files with 235 additions and 23 deletions
+10
View File
@@ -5,6 +5,7 @@ using CarParkValidationAPI.Models.Users;
using CarParkValidationAPI.Interface;
using System.Threading.Tasks;
using CarParkValidationAPI.Models;
using System;
namespace CarParkValidationAPI.Controllers
{
@@ -78,5 +79,14 @@ namespace CarParkValidationAPI.Controllers
var user = await _userService.GetById(id);
return Ok(user);
}
/* download the excel file */
[HttpGet("[action]")]
public async Task<IActionResult> GetReportFile()
{
// this.Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
var result = await _userService.GetAllUserReport(); // .GetReport(fromDate, toDate);
string fileContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; //Map(result.Data.FileName);
return File(result.Data.Content, fileContentType, result.Data.FileName);
}
}
}