I have the following linq expression pulling all data from my database:
var items = response.Select(a => a.SessionLocationID).ToArray();
mdl = _meetingRepository.Select<SessionLocation>()
.OrderBy(a => a.SessionDT).ThenBy(a => a.SessionEndTime);
Now I want to group by the field ActualRoom and only the ones with ActualRoom count > 3
Is that possible?
You can use
GroupBy, just keep in mind that you are losing the ordering you already did so I would start off before you do the sorting:To have sorted groups – assuming preserving the count as a separate property is not neccessary you can just project to an
IEnumerableofIEnumerable<SessionLocation>: