Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Poor performance get EntityState

$
0
0
Hello,

Recently we moved our big project from EF6.0.2 ObjectContext to EF6.0.2 DbContext.
And noticed poor performance of getting entity state after loading large set of data.

Example: we have several tables

-Category (100 items)
--Elements (1000 items)
--Validity (1 item)
--Activities (50 items)
.....

This code is quick (5ms):
var category = context.Categories.First();
var state = context.Entry(category).State;

But after loading all references getting the state takes more then 2 seconds:

[Pseudocode]

var category = context.Categories.Include("..").Include("..").Last();
var state = context.Entry(category).State;

Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>