In my controller I have the following: and it working.
If I pull everything from the table it works:
[HttpGet] public async Task<ActionResults> GetAll() { return Json(new { data = await _dbConnection.Cars.ToListAsync() }); }
however, when I create LINQ query to only get certain columns returned, I get an 500 error. InvalidOperationException: Property 'JsonResults.SerializerSettings' must be an instance of type 'System.Text.Json.JsonSerializerOptions'
[HttpGet] public async Task<ActionResults> GetAll() { var q = _dbConnection.Cars; return Json(new { data = query .Task(20) .Select(x=> new { Make = x.Make, Model = x.Model, Type = x.ModelType }) }, await query.ToListAsync()); }