Hi @muttBunch , Welcome to Microsoft Q&A,
You can convert the data from a list of objects to a nested array format before returning the JSON result.
public async Task<IActionResult> Get24HourLogonsById(int id, CancellationToken token)
{
var result = _applicationDbContext.Database
.SqlQueryRaw<ArrayTest>(query);
var transformedResult = result
.Select(r => new object[] { r.Count, r.Time })
.ToList();
return new JsonResult(transformedResult);
}
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.