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;
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;