public class Note
{
public string account;
public DateTime noteDate;
public string noteText;
}
List<Note> List1;
Run Code Online (Sandbox Code Playgroud)
使用LINQ我正在寻找一种方法来组合noteText
何处account
和noteDate
相同.例如,如果传入列表有三个对象:
List1[0] = "1234", 2017-10-03, "This is a"
List1[1] = "1234", 2017-10-03, " sample note."
List1[2] = "4321", 2017-10-03, "This is another note."
Run Code Online (Sandbox Code Playgroud)
我希望新列表有两个对象:
List2[0] = "1234", 2017-10-03, "This is a sample note."
List2[1] = "4321", 2017-10-03, "This is another note."
Run Code Online (Sandbox Code Playgroud)