I have two lists …
List<ObjectA> listA
List<ObjectB> listB
Both have a int property ID, that is unique…
I´d like to get all objects from listA that have listA[x].ID = listB[x].ID, using LINQ…
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to use the
.Join(...)function.In query syntax, it would look something like this:
In standard C# syntax, it would look something like this: