I get the warning message
This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
The code that produces this warning is
app.MapGet("/questionsByCategory", async (Context dbContext, int categoryId, bool inTest) =>
{
IQueryable<Questions> result = dbContext.Questions
.AsNoTracking()
.Where(x => x.CategoryId == categoryId)
.Include(x => x.Answers)
.AsQueryable();
if (inTest)
result.Where(x => x.InTest == true);
return Results.Ok(result);
})
.WithName("questionsByCategory")
.WithOpenApi();