Orderby after groupby

I have a query that I'm using to group the records.

tblAgentActivities
.Where (aa => aa.StartDate >= DateTime.Today)
.OrderBy (aa => aa.AgentActivityID)
.GroupBy (aa => aa.tblUser.FullName)
.OrderBy (aa => aa.Key)

When I run this, I get a bunch of nested tables grouped by "FullName", which is what I want. But I want to be able to sort those tables by AgentActivityID, which I can't.

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!