这是我的数据结构;
public class Note { public string id; public string content; public string pid; }
这是我的数据
List<Note> notes = new List<Note>(){ new Note{id="001",content="001",pid=""}, new Note{id="002",content="002",pid=""}, new Note{id="003",content="003",pid="001"}, new Note{id="004",content="004",pid="002"}, new Note{id="005",content="005",pid="001"}, new Note{id="006",content="006",pid="002"}, new Note{id="007",content="007",pid="003"}, new Note{id="008",content="008",pid="003"}, };
这是我希望得到的查询结果
new Note{id="001",content="001",pid=""}, new Note{id="003",content="003",pid="001"}, new Note{id="005",content="005",pid="001"}, new Note{id="007",content="007",pid="003"}, new Note{id="008",content="008",pid="003"},
也就是说,查询ID为001下面的所有子集,子子集了。一直找下去,
请问一下用lambda怎么写呀。