views:

153

answers:

1

Hi,

I want to have following type of query in entity frame work

SELECT  c2.* 
FROM    Category c1 INNER JOIN Category c2
ON      c1.CategoryID = c2.ParentCategoryID
WHERE   c1.ParentCategoryID is NULL

How to do the above work in Entity framework...

+3  A: 

Well, I don't know much about EF, but that looks something like:

var query = from c1 in db.Category
            where c1.ParentCategoryId == null
            join c2 in db.Category on c1.CategoryId equals c2.ParentCategoryId
            select c2;
Jon Skeet
This is fine. I know that one, but i need in EF. Any way Thanks...
Waheed
@Waheed: I don't know what you mean - you should be able to use that exact query in EF.
Jon Skeet