Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
var q1= Mystudententities.Student.Select(x=>x.ID).ToList();

var q2= Mystudententities.Person.Select(x=>new
{
ID=x.ID,
Name=x.Name

}).ToList();



I want to find ids and names that are common to 2 query ids. How do I.

Student

ID

1

2

3


Person

1   Alex

2   John

4   Mary


I want to this result query in lambda expression


1  Alex

2  John


What I have tried:

var q1= Mystudententities.Student.Select(x=>x.ID).ToList();

var q2= Mystudententities.Person.Select(x=>new
{
    ID=x.ID,
    Name=x.Name

}).ToList();
Posted
Updated 2-Jan-20 22:05pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900