Accepted answer

i found a solution:

at first it seems that with the dataloadoptions is something not okay, at second its not clever to load a table with 30 coloumns when you only need 1.

to solve this, i make a view which covers all nececeery fields and of course the join.

it reduces the time from 5.0 seconds to 230ms!


if you want to get rid of the loadwith, you can select your field explicitly :

public static list<tuple<userpm, user> > getallpmsasreciepient(guid userid)
    using (var datacontext = new rpgdatacontext())
        return (
            from a in datacontext.userpms 
            where a.recieverid == userid 
            && !a.isdeletedrec 
            orderby a.timestamp descending 
            select tuple.create(a, a.user1)

Related Query

More Query from same tag