I’m doing this on a table with ~43k rows:
MyDbContext.Stores.Load();
MyDbContext.Stores.Local.Count.Dump(); //horrible performance!
I can see through the profiler that the first instruction fires up the select statement to fetch all rows. Actually the second instruction returns the correct value but after ~12 seconds, and it is not what I was expecting considering that all data should be in memory.
What is wrong (or what is its real purpose) with .Local in Entity Framework?
I think you should do this:
DbSet.Local Property