I am trying to run the following code, but when I check the SQL profiler, it looks like it makes a full selection in the table and then groups it after it returns all the results from the database. Any help is appreciated.
var result = _dbContext.LogEvent.GroupBy(x => x.EventLevel) .Select(g => new { eventType = g.Key, total = g.Sum(i => i.Occurrences) }) .ToList();
asp.net-core asp.net-core-mvc entity-framework-core
Rickjames
source share