I am new here, and a newbie in asp.net core.
I am writing a web api using asp.net core 3.0. I wrote the following API endpoint code to retrieve a list of Databases
entities and group them by a field named Value
from another object Type
.
//GET:api/Databases/graph
[HttpGet("graph")]
public async Task<ActionResult<IEnumerable<IGrouping<string, Database>>>> GetGraphDatabases()
{
return await _context.Databases
.Include(t => t.Type)
.Where(d => d.Type.Code == "DATABASE_TYPE")
.GroupBy(d => d.Type.Value)
.ToListAsync();
}
But when I try to reach the endpoint, I get the following error message: InvalidOperationException: Client side GroupBy is not supported.
I checked this answer but it didn't help much.
Can you please support.