我有一个清单
List<List<Employee>> EmployeeListCollection;
并且想要
List<Employee> EmployeeList=//all employee in EmployeeListCollection
什么是查询?
我有一个清单
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);
}
}