I have a master list of complex objects.
I have a list of int ids that I need to select the corresponding complex object out of the master list.
this doesn't work
MasterListofComplexObj.Where(u => MasterListofComplexObj.Select(i => i.Id).Contains(ChildListofIntIds));
any help would be appreciated.
This should work:
var results = MasterListofComplexObj.Where(u => ChildListofIntIds.Contains(u.Id));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With