0
我有这个类:如何订购清单中的物品并删除基于物业的重复物品?
public class User
{
public long Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Username { get; set; }
public int Contributions { get; set; }
}
我List<User>
可以包含具有相同Id
但不同Contributions
值多个项目。
我想拥有基于Id
的不同值,但是Id
的值最高为Contributions
。我怎样才能做到这一点?谢谢。
我试过,但它只是我想要的一部分:
list.OrderByDescending(x => x.Contributions);
谢谢@qxg。 – Blendester