Accepted answer

your sql query can be translated to this linq query:

var query =(from t in context.titles
            join td in context.titledetails on equals td.titleid into tds
            from e in tds.defaultifempty()
            where e.orderdate!=null
            group  e.orderdate by new {, t.limpisbn, t.casedisbn} into groups
            from g in groups
            select new { name =,
                        limpisbn = g.key.limpisbn,
                        casedisbn = g.key.casedisbm,
                        lastorder = g.max(x => x)})


almost like that

var last5item = from td in context.titledetails.orderbydescending(i => i.orderdate).take(5)
                join t in context.titles on td.titleid equals
                select ..

Related Query

More Query from same tag