鉴于以下情况,我希望能够根据两个字段提取非不同的值:名称和国家/地区。在这个例子中,我想返回列表中的前两个。
List<City> cities = new List<City>
{
new City{ Name = "Sydney", Country = "Australia", Galaxy = "Mine" },
new City{ Name = "Sydney", Country = "Australia", Galaxy = "Yours" },
new City{ Name = "New York", Country = "USA", Galaxy = "Ours"},
new City{ Name = "Paris", Country = "France", Galaxy = "Theirs" },
};