我有以下 SQL 查询...
select seaMake AS Make,
seaModel AS Model,
COUNT(*) AS [Count],
MIN(seaPrice) AS [From],
MIN(seaCapId) AS [CapId]
from tblSearch
where seaPrice >= 2000
and seaPrice <= 7000
group by seaMake, seaModel
order by seaMake, seaModel
我试图将其编写为 LINQ to Entities 查询,但我遇到了问题。这是我到目前为止所拥有的,但我无法从 var S 访问品牌和型号值
var tester = from s in db.tblSearches
where s.seaPrice >= 2000
&& s.seaPrice <= 7000
orderby s.seaMake
group s by s.seaMake into g
select new
{
make = g.seaMake,
model = s.seaModel,
count = g.Max(x => x.seaMake),
PriceFrom = g.Min(s.seaPrice)
};
我哪里错了?