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

xslt - Substring before throwing error -

Google Cloud Bigtable Durability/Availability Guarantees -

Android M doze mode and "native" posix socket freezing up -