I have Student list with below data
/*----------------------- |Student | ------------------------- | ID | Name | Dept | ------------------------- | 101 | Peter | IT | | 102 | John | IT | | 103 | Ronald | Mech | | 104 | Sam | Comp | -----------------------*/ Other list say Extra with below data
/*---------------------- | StudentId | Dept | ------------------------ | 101 | Civil | | 103 | Chemical | ----------------------*/ Now I want following result
/*------------------------- |Student | --------------------------- | ID | Name | Dept | --------------------------- | 101 | Peter | Civil | | 102 | John | IT | | 103 | Ronald | Chemical | | 104 | Sam | Comp | -------------------------*/ Currently I have written below logic:
foreach(item in Extra) { //Search item in Student list //Update it } I need more efficient way (don't want to use iteration) using LINQ.