I use EF 4 and c#,MSQ 2008.
我有一个T-SQL:
select COUNT(*)
from CmsContents
where IsPublished = 1 and isDeleted = 0
GROUP BY Day(Date)
我需要把它转化成欧洲论坛,但我无法做到这一点。
这里我用的是:
var contentsByMonth = context.CmsContents
.Where(c => c.IsPublished == true & c.IsDeleted == false)
.GroupBy(c => c.Date.Month).ToList().Count();
你们能否给我一个榜样? 增 编