Exemplo n.º 1
0
        public static void GetSetMemoryTest()
        {
            MemCacheProvider cache = new MemCacheProvider();

            Person P = new  Person {
                FirstName = "F1", LastName = "L1"
            };

            cache.Add <Person>(P, "Person");
            Object pGet = cache.Get <Person>("Person");

            bool result = MemCacheProvider.Remove("Person");

            //bool isPerson = MemCacheProvider.Exists("Person");

            //object pGet2 = MemCacheProvider.Get("Person");

            //MemCacheProvider.ClearAll();
        }
Exemplo n.º 2
0
        public static void GetSetMemoryTestAsInWebApp()
        {
            MemCacheProvider cache = new MemCacheProvider();

            string keyPerson = "Person";
            Person P         = new Person {
                FirstName = "F1", LastName = "L1"
            };

            cache.Add <Person>(P, keyPerson);
            string str1 = cache.GetJsonString(keyPerson);

            Object pGet = cache.Get <Person>(keyPerson);

            bool result = MemCacheProvider.Remove(keyPerson);

            //bool isPerson = MemCacheProvider.Exists("Person");

            //object pGet2 = MemCacheProvider.Get("Person");

            //MemCacheProvider.ClearAll();
        }