title: translate postgres sql to linq. Is it possible?
body: <p>I need translate next sql to linq is it possible? That will have approximately the same speed</p>
  
  <pre><code>  SELECT Count(tblcollectionimage.lngimageid), 
     tblcollectiontree.lngcollectionid, 
     tblcollection.txtname 
    FROM   (tblcollectiontree  
            LEFT JOIN tblcollectionimage 
                   ON blcollectiontree.lngcollectionid = 
     tblcollectionimage.lngcollectionid) 
     JOIN tblcollection 
       ON tblcollectiontree.lngcollectionid = tblcollection.lngcollectionid 
    WHERE  lngcollectionparentid = 0 
    GROUP  BY tblcollectiontree.lngcollectionid, 
        tblcollection.txtname 
  </code></pre>
  
  <p>I have currently such linq but it doesn't work.</p>
  
  <pre><code>  var results =(from collection in dataBase.tblcollections 
    join collectionTree in dataBase.tblcollectiontrees on 
    collection.lngcollectionid equals collectionTree.lngcollectionid 
    into generalCollections
    from generalCollection in generalCollections 
    join images in dataBase.tblcollectionimages on 
    collection.lngcollectionid equals images.lngcollectionid 
    into generalCollectionImages
    from generalCollectionImage in 
    generalCollectionImages.DefaultIfEmpty()
    group generalCollectionImage by 
    generalCollectionImage.lngcollectionid into hello
    from hellos in hello.DefaultIfEmpty() 
    join collection in dataBase.tblcollections on 
    hello.Key equals collection.lngcollectionid
  
    select new
    {
        id = hello.Key,
        name = hello.Count()
    }).ToList();
  </code></pre>