Setting a property from one collection to another collection

Posted by ooo on Stack Overflow See other posts from Stack Overflow or by ooo
Published on 2010-06-07T20:42:07Z Indexed on 2010/06/07 20:52 UTC
Read the original article Hit count: 158

Filed under:
|
|

I have two colluections

List<Application>  myApps;

List<Application> yourApps;

These lists have overlapping overlapping data but they are coming from different sources and each source has some missing field data.

Application object has a property called Description

Both collections have a unique field called Key

i want to see if there is a LINQ solution to:

Loop through all applications in myApps and look at the key and see if that existing in yourApps. If it does, i want to take the description property from that application in yourApps and set the description property on the application on myApps to that same value

i wanted to see if there was any slick way using lambda expressions (instead of having to have loops and a number of if statements.)

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ