linq查询去除重复的记录

2024-12-03 21:15:30
推荐回答(2个)
回答1:

var value=(from v in db.tbl select v.name).Distinct().ToList();

回答2:

(from v in db.tbl select v.name).Distinct(m=>m);