-3

I have two tables:

1) Customer Table 2) Custmer Email Table

enter image description here enter image description here

what i want to get both email ids which have customerId=4. can I make a union and get my desire result like: **

cusromerId:4
EmailId: sumit.printzone@gmail.com
         vinod.printzone@gmail.com

**

1 Answers1

1

In lambda syntax this is what you want:

var emails = firstTable
    .Where(row => row.Id == 4)
    .Select(row => row.Email)
    .Union(secondTable
        .Where(row => row.Id == 4)    
        .Select(row => row.Email));
JamesFaix
  • 8,050
  • 9
  • 37
  • 73