var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllersWithViews();
builder.Services.AddDataTables("sqlite", "Data Source=./db.sqlite"); // <----------- NEW!
var app = builder.Build();
app.UseStaticFiles();
app.MapDefaultControllerRoute();
app.Run();
Usage:
public CarsController(Database db) : ControllerBase // new primary constructors
{
[HttpGet("DataTable")]
[HttpPost("DataTable")]
public ActionResult<DtResponse> GetDataTable()
{
// db.XYZ
}
}
I have created my own but I am having other issues with my approach in the context of integration tests with TestHost and a custom WebApplicationFactory.
Usage:
Usage:
I have created my own but I am having other issues with my approach in the context of integration tests with TestHost and a custom WebApplicationFactory.