Resolved it myself
OnInitializedAsync() was trying to call an API that wasn't async. This resulted in the JSON object I returned was empty when it mattered.
Before:
app.MapGet("/api/blob", (IBlobService blobService) => blobService.GetStrings());
app.MapGet("/api/sql", (ISqlService repo) =>
{
var sqlDiners = repo.GetLastestDiners();
return sqlDiners is not null
? Results.Ok(sqlDiners)
: Results.NotFound("No customers found.");
});
After:
app.MapGet("/api/blob", async (IBlobService blobService) => await blobService.GetStrings());
app.MapGet("/api/sql", async (ISqlService repo) =>
{
var sqlDiners = await repo.GetLastestDiners();
return sqlDiners is not null
? Results.Ok(sqlDiners)
: Results.NotFound("No customers found.");
});