I have 2 collections of customers:
- all customers list
- related customer list
All customers list has all the customers. Related customers list contains some customers from the "all customers list"
I want to return a 3rd collection called mergedCustomers where I can execute a function/logic to create a new class "MergeCustomer" where the Id of each collections elements are equal and for those I set on the new mergeCustomer a property IsSelected = true.
My 3rd collection must of course return all customers, I just want that the IsSelected property is changed where all customers match with related customer collection.
What is the linq function to do this?
The easy way:
The Join way:
Another way (I think this should work):