c# Entity Framework does not execute sql -


i have next code:

guid[] sessions; while ((sessions = getsessions()).any()) {     sessions.asparallel().forall(processsession); } ...   private guid[] getsessions() {    using (var tmpcontext = new mydbcontext())    {        return (from pendingsession in tmpcontext.pendingsessions                !tmpcontext.pendingfiles.any(pf => pf.pendingsession.sessionid == pendingsession.sessionid)                select pendingsession.sessionid).toarray()       } } 

i have traced code running sqlserver profiler , recognized entityframework doesn't execute on sqlserver side query getsessions method on each call of method... mean sql executed , getsessions method running without execution of sql query on sqlserver side. cause problems in processsession method.

what can reason entityframwork decide not execute query, , way make run each time?

thanks, aleksey


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -