c# - Entity Framework DBContext.Entry() is very slow -


i trying data out of database. using .entry slow, on 65% of time spent right there. have ideas how optimize query? want data read only.

enter image description here

sorry adding code image, not let me post question when formatted using code sample button.

your query definitively far being optimized. try instead:

seismic2dsurvey.endsandbends = winpicsdbcontext.locations     .where(t => t.surveyid = seismic2dsurvey.id && (t.isbend || (t.isend.hasvalue && t.isend.value))).orderby(t => t.tracenumber).tolist();  seismic2dsurvey.tracecount = locations.count(); seismic2dsurvey.surveylocations = null; 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -