Reputation: 4811
I have a collection of Users List where User looks like: User -id -uniqueKey (String)
I have another collection of List where ExternalUser has a uniqueKey also.
I want to loop through the List, but actually return a External User.
How can I create an iterator that does this?
Upvotes: 0
Views: 71
Reputation: 205
Without having your sample code, it is hard to fully answer. However, this is a code sample that I believe would provide you with what you are looking for:
var externalUsers = users.Select(user => externalUserIds.Contains(user.UniqueKey));
That will provide you with a iterator of user object instances which have a UniqueKey of an external user.
Upvotes: 1