データベース内で電話番号が重複しているすべてのディーラーを探しています。次に、すべてのディーラー情報を含むレポートにそれらをリストしたいと思います。select ステートメントにディーラー レコード属性を設定するのに問題があります。
ディーラー名住所など 4 番目。group by がそれを制限しているためだと思います。
var dealers = _db.Dealers
.Where(x => x.Active)
.GroupBy(x => x.Phone)
.Select(x => new { Dealer = x.Key, Phone = x.Count()})
.Where(x => x.Phone > 1);
編集: 望ましい出力は、各ディーラーのリストです。同じ電話番号の販売店を並べて表示したい。電話番号に基づいて重複していないレコードは必要ありません。