Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Nested Select in LINQ using Lambda expression

$
0
0

I am sure this will be a super easy one for someone. I know sql but am not too familiar with lambda expressions.

I would like to write a nested select where the results of the first select  can be used to pull information from the table in the second select.

variable ContactId

TableA

pid, cid

TableB

cid, customerName

tableA.Where(x=>x.pid == ContactId).SelectMany(x=>x.cid)...

I literally have no clue here...

Just for clarity i want to return the Customer Name for all the CIDs returned from the first query

Can someone enlighten me.

TIA

Ilan


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>