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

Self Join using EF and lambda expression

$
0
0

Hi All,

I have a query written in sql. See the below code.

SELECT
a.bintId_Pk, 
a.viewtitle, 
b.viewtitle 

FROM AdminSection_GEN a 
JOIN AdminSection_GEN b

ON a.bintId_Pk = b.IntParentId_FK 
ORDER by a.bintId_Pk

Now I started using EF with lamda expression I need above query result in .ToList()

I started like beow

MyEntities db = new  MyEntities ()
List<MyModel> _sample = db.AdminSection_GEN...........

Could you please suggest the syntax to implement the self join.

Thanks


Viewing all articles
Browse latest Browse all 1698

Trending Articles



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