Exemplo n.º 1
0
        public void GetComplexObject()
        {
            ClientCache.Current.SetOrUpdateAsync(OBJECT_KEY_COMPLEX, ComplexObject.CreateSimple("ComplexObject"), new CacheItemPolicy(TimeSpan.FromMinutes(1)), REGION_NAME).GetAwaiter().GetResult();

            var result = ClientCache.Current.TryGetAsync <ComplexObject>(OBJECT_KEY_COMPLEX, REGION_NAME).GetAwaiter().GetResult();

            Assert.AreEqual <string>("ComplexObject", result.Name);
        }
Exemplo n.º 2
0
        public void RemoveComplexObject()
        {
            ClientCache.Current.SetOrUpdateAsync(OBJECT_KEY_COMPLEX, ComplexObject.CreateSimple("ComplexObject"), new CacheItemPolicy(TimeSpan.FromMinutes(1)), REGION_NAME).GetAwaiter().GetResult();

            var result = ClientCache.Current.TryDeleteAsync(OBJECT_KEY_COMPLEX, REGION_NAME).GetAwaiter().GetResult();

            Assert.AreEqual <ExecutionResult>(ExecutionResult.Done, result);
        }
Exemplo n.º 3
0
 public void AddComplexObject()
 {
     ClientCache.Current.SetOrUpdateAsync(OBJECT_KEY_COMPLEX, ComplexObject.CreateSimple("ComplexObject"), new CacheItemPolicy(TimeSpan.FromMinutes(1)), REGION_NAME).GetAwaiter().GetResult();
 }