I have two lists, A and B. Both are lists of an object named Obj which has two properties: ID and Name.
I need to check if all items in A exist in B by comparing their names.
If yes, then return true. If not then return false.
Could someone, please, help me creating this?
I tried the following but it is not working:
bool FoundAll = (from b in B join a in A on b.Name equals a.Name select b).Any();
bool foundAll = A.All(a => B.Any(b => a.Name == b.Name));
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?