Selecting count in LINQ

后端 未结 4 982
忘掉有多难
忘掉有多难 2021-01-14 00:50

I got a SQL Server table with columns ResolvedDate and ResolvedBy.

Now I want to select those two columns and count their results, which I

4条回答
  •  -上瘾入骨i
    2021-01-14 01:23

    from a in dataContext.Activities
    where a.IsResolved && a.ResolvedBy == userId
    group a by a.ResolvedDate into g
    select new {ResolvedOn=g.Key, NumberResolved= g.Count()}
    

提交回复
热议问题