1
我有一个列表如何使用Linq将列表集合添加到列表中?
List<List<Employee>> EmployeeListCollection;
,并希望
List<Employee> EmployeeList=//all employee in EmployeeListCollection
什么是查询?
我有一个列表如何使用Linq将列表集合添加到列表中?
List<List<Employee>> EmployeeListCollection;
,并希望
List<Employee> EmployeeList=//all employee in EmployeeListCollection
什么是查询?
List<Employee> EmployeeList = EmployeeListCollection.SelectMany(c => c).ToList();
试试这个:
List<List<Employee>> EmployeeListCollection;
List<Employee> EmployeeList;
foreach(var emplst in EmployeeListCollection)
{
foreach(var emp in emplst)
{
EmployeeList.add(emp);
}
}
你的问题是模糊的,你能解释一下你需要什么??? – IamStalker 2012-08-07 07:19:36
对不起,我英语真的很差,所以我通常会在我有问题时试着给我提供样品,而且我认为这个样品很明确,而且你看到别人明白我的意思了! – 2012-08-07 07:39:38