As Luhmann has already said my mate Jarek has an excellent sample Caching provider for the Entity Framework. Which he talks about here.
However sometimes this approach is overkill, and I suspect that caching countries is a good example where the effort isn't worth it. It maybe better to implement some sort of ad-hoc caching.
If you try to do this the main problem you will run into is that an instance Entity Framework entity can only be attached to one ObjectContext at a time, which means if you are getting concurrent requests (like in a website) you will have problems is you just grab items from the cache and use them blindly.
What you need is a cloning cache, i.e. so when you grab something from the cache it clones them.
I put together a tip that illustrates how to do this Tip 14 - How to cache Entity Framework Reference Data
Hope this helps
Alex James
Entity Framework Team Microsoft.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…