Yo dawg! I heard you like cache, so we put a caching mechanism in yo server side cache, so you can cache while you cache!...but seriously, PLINQO now includes a built in caching mechanism!
Exampleusing (var context = new PetshopDataContext()) { // Cache a result set. (A query is made to the DB.) var birds = context.Product.GetByCategoryId("BIRDS").FromCache().ToList(); // Get a single entity from that cache. (No query is made to the DB.) var firstBird = context.Product.GetByCategoryId("BIRDS").FromCache().FirstOrDefault(); // Specify number of seconds to cache. (A query is made to the DB.) var penguin = context.Product.GetByName("Penguin").FromCache(60).FirstOrDefault(); // Get the same result set back as a list. (No query is made to the DB.) var penguins = context.Product.GetByName("Penguin").FromCache(60).ToList(); } Configuration This feature is is not yet available in an official PLINQO release, to use the cache you will have to download the latest PLINQO Nightly Build.
To access the FromCache extension method you must...