我有以下查询,我想将其转换为 LINQ to SQL (c#),但我遇到了困难。
select title, barcode, count (*) as pop_rank
from favourites
group by barcode, title
order by pop_rank desc
我做到了
DataContext db = new DataContext();
using (db)
{
var test = from t in db.favourites
group t by new
{
t.barcode,
t.title
};
}
我正在努力按功能添加计数和顺序。
谢谢