I have IQueryable
baseList
and List
someData
What I want to do is update attributes in some
To pair elements in the two lists you can use a LINQ join:
var pairs = from d in someData
join b in baseList.AsEnumerable()
on d.someCode equals b.myCode
select new { b, d };
This will give you an enumeration of each item in someData
paired with its counterpart in baseList
. From there, you can concatenate in a loop:
foreach(var pair in pairs)
pair.b.SomeData += pair.d.DataIWantToConcantenate;
If you really meant set concatenation rather than +=
, take a look at LINQ's Union, Intersect or Except methods.