Answer the question
In order to leave comments, you need to log in
How to do a join in Entity Framework?
select dbo.A.Link,dbo.B.Image, ...
From dbo.A INNER JOIN
dbo.B ON dbo.A.Site = dbo.B.Site AND dbo.AC = dbo.BC
where(dbo.A .Link = @categ) AND (dbo.A.Site = @site) and (dbo.B.Link = @SubCateg)
how to define this query in EF?
Answer the question
In order to leave comments, you need to log in
Approximately like this
var temp = from t in A
join b in B on t.Site = b.Site AND t.C = b.C
where condition
select what you need
var result = dbContext.A.Join(dbContext.B, a => new { a.Site, a.C }, b => new { b.Site, b.C }, (a, b) => new { a, b })
.Where(joinedObject => joinedObject.a.Link == someValue && joinedObject.a.Site == someOtherValue && joinedObject.b.Link == thirdValue )
.Select(joinedObject => ...)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question