开发者

How to convert this SQL query to Linq to Entity query?

could you help me please convert this SQL query to开发者_StackOverflow社区 Linq to Entity query? Thank you

select distinct item, count(item) as count 
from TableName 
where ColumnName = @parameter and (ColumnName2 = @parameter2 OR ColumnName3 = @parameter3)
group by item  order by item asc


from TableName in db.TableName
where TableName.Column1 == 'param1' 
    && ( TableName.Column2 == 'param2' || TableName.Column3 == 'param3' )
group item by new { TableName.Item } into t
orderby t.Key.Item
select new {  t.Key.Item,  ItemCount = t.Count() }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜