public static IEnumerable <T> GetAll(Cache cache, DbContext dbContext) { var action = new Func <IEnumerable <T> >(dbContext.Set <T>); var things = ((IEnumerable <T>)BaseCache.GetInsertCacheItem(cache, typeof(T).Name, action, null)); return(things); }
//An example of caching. public static IEnumerable <string> GetDummyData(Cache cache) { var action = new Func <IEnumerable <string> >(() => { return(new List <string>() { "foo", "bar", "lipsum" }); }); var things = ((IEnumerable <string>)BaseCache.GetInsertCacheItem(cache, BaseCacheNames.DummyData.ToString(), action, null)); return(things); }