예제 #1
0
        private void test2()
        {
            var config = new CacheConfig {
                Name = "Locust.Test__cache"
            };
            var cache = new AppDomainCacheManager(config);

            var type = cache.Get("key1");

            System.Console.WriteLine(type != null && (type as Type) == this.GetType());
        }
예제 #2
0
            public override void Test()
            {
                var config = new CacheConfig {
                    Name = "Locust.Test__cache"
                };
                var cache = new AppDomainCacheManager(config);

                var prop    = cache.Get("key1", () => myClass.GetType().GetProperty("Alpha12", BindingFlags.Public | BindingFlags.Instance));
                var alpha12 = Convert.ToInt16(prop.GetValue(myClass));

                alpha12++;
            }