Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        //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);
        }