Accepted answer

do something like this : (update column name as per yours)

var query = (from c in testresult
        join tbl2 in testresultrelated on equals tbl2.testresult 
        where c.user_login_name = 'emilwkj' and != ''
        group tbl2 by into g
        select new 
            id =,
            name =,
            testresultrelated = g
        .distinct()   //.distinct(x=>x.somecolumn) 
        .orderbydescending(x =>;


as we understand you are using efcore and dbcontext heaving testresult and testresultrelated table.

here is the code of problem that we understand from your question.

var db=new dbcontext();
var result = (from a in db.testresult
             join b in db.testresultrelated on equals b.testresult
             where b.path == "testresultrelatedadditionaldata.softwareversion"
             & a.user_login_name == "emilwkj" &!=" "
             group b by into item
             orderby item.max(e=>e.start_date_time) descending
             select item)

Related Query

More Query from same tag