开发者

Left Join with Entity Framework

someone can tell me how to do this query in EF1: select a.idAnimali, a.titolo, a.commenti, a.ordine, a.idcatanimali, table1.nomefoto FROM tabanimali as a LEFT JOIN (SELECT idanimali, nomefoto tabfotoanimali FROM LIMIT 1) AS Table1 On a.i开发者_开发百科dAnimali = table1.idanimali WHERE a.idcatanimali = idcatanimale

Thanks


Let me know if this works for you, i think what u posed has a typo and i am assuming tabfotoanumali is your second table.

  var query = (from a in tabanimali
    join p in tabfotoanimali.FirstOrDefault() on a.idanimali equals p.idanimali 
    where a.idcatanimali = idcatanimale
    select new {
             a.idAnimali, 
             a.titolo, 
             a.commenti, 
             a.ordine, 
             a.idcatanimali,
             p.nomefoto
     }
  );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜