C# 如何更改示例中的sql查询?

C# 如何更改示例中的sql查询?,c#,sql,linq,C#,Sql,Linq,我已经尝试过了,但无法将此t-sql转换为linq select title , count(number) as order_number from order group by title 它将是这样的: var result = context.order .GroupBy(p=>p.title) .Select(p=> new {title = p.Key, order_num

我已经尝试过了,但无法将此t-sql转换为linq

select title , count(number) as order_number from order
group by title

它将是这样的:

   var result = context.order
                       .GroupBy(p=>p.title)
                       .Select(p=> new {title = p.Key, order_number = p.Count()})

添加列名
title=p.Key,order\u number=p.Count()
。如何对间隔日期标题进行分组,但选择日期和计数标题。例如:.GroupBy(p=>p.title)。选择(p=>new{p.dateSend,order_number=p.Count())。得到错误@按日期和标题列出的AnaMah组?我想得到这个列表->{date,number.Count()}:{“2010”,5},{“2011”,11},{“2012”,6}。分组title@AnaMah你能写SQL查询吗?