赞
踩
var A = new[]
{
new
{
key1=value1,
key2=value2
},
new
{
key1=value1,
key2=value2
}
}
var items = departments.GroupJoin( employees, department=>department.Id, employee=>employee.DepartmentId, (department, departmentEmployees)=>new { department.Id, department.Name, Employees=departmentEmployees }); foreach(var item in items) { Console.WriteLine(item.Name); foreach(Emplyee employee in item.Employees) { Console.WriteLine(employee); } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。