views:

13

answers:

0

Hello,

I'd like to make a query with linq to entities that looks like this :

SELECT      listid,;
            itemid,;
            ( SELECT langs.desc;
                  FROM langs;
                  WHERE langs.langid = 1 AND langs.itemid=l.itemid) as fr,;
            ( SELECT langs.desc;
                  FROM langs;
                  WHERE langs.langid = 2 AND langs.itemid=l.itemid) as nl,;
            ( SELECT langs.desc;
                  FROM langs;
                  WHERE langs.langid = 3 AND langs.itemid=l.itemid) as en,;
            logistics;
      FROM list as l;
      WHERE listid=100

With linq to entities :

 var dropdownvalues = from ddln in db.DropDownListName
                                 from ddlv in ddln.DropDownListValue
                                 where ddln.Id == DDLNameId
                                 select new { 
                                     ddlv.Id,
                                     from ddlv_t in db.DropDownListValue_Translation
                                     where ddlv_t.DDLVId == ddlv.Id
                                     select ddlv_t.Traduction                                                                                     
                                 };

But my intermediate object is anonymous and I have an error.

Sorry for my bad english and thank you!