开发者

Preloading entities with EF4

开发者 https://www.devze.com 2023-01-14 01:46 出处:网络
I have a bunch of classificators which will be used quite often. I wan\'t to preload those entities when my program st开发者_运维技巧arts so that I wouldn\'t have to do it later when any object refere

I have a bunch of classificators which will be used quite often. I wan't to preload those entities when my program st开发者_运维技巧arts so that I wouldn't have to do it later when any object references them.

How can this be done in EF4?


There's a long-ish walkthrough here:

How to Cache Entity Framework Reference Data

But profile first. Writing good projections may be faster than materializing entire entities with cached references. Even loading single referenced objects is quite fast. Don't "optimize" stuff which isn't slow.

0

精彩评论

暂无评论...
验证码 换一张
取 消