linq distinct List<Product> distinctProduct = allProduct .GroupBy(p => new {p.Id, p.Name} ) .Select(g => g.First()) .ToList(); 分组取第一条数据