Exemple #1
0
 public void RunManager()
 {
     var ordersMemoryManager    = new OrdersManager(new EntitiesMemoryCache <Order>());
     var ordersRedisManager     = new OrdersManager(new EntitiesRedisCache <Order>("localhost"));
     var categoryMemoryManager  = new CategoriesManager(new EntitiesMemoryCache <Category>());
     var categoryRedisManager   = new CategoriesManager(new EntitiesRedisCache <Category>("localhost"));
     var customersMemoryManager = new CustomersManager(new EntitiesMemoryCache <Customer>());
     var customersRedisManager  = new CustomersManager(new EntitiesRedisCache <Customer>("localhost"));
 }
        public void RedisCacheCustomers()
        {
            var customerManager = new CustomersManager(new CustomersRedisCache("localhost"));

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(customerManager.GetCustomers().Count());
                Thread.Sleep(100);
            }
        }
        public void MemoryCacheCustomers()
        {
            var customerManager = new CustomersManager(new CustomersMemoryCache());

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(customerManager.GetCustomers().Count());
                Thread.Sleep(100);
            }
        }
Exemple #4
0
        public void CustomersRedisCache()
        {
            var categoryManager = new CustomersManager(new CustomersRedisCache("localhost"));

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(categoryManager.GetCustomers().Count());
                Thread.Sleep(100);
            }
        }
Exemple #5
0
        public void CustomersMemoryCache()
        {
            var manager = new CustomersManager(new CustomersCache());

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(manager.GetCustomers().Count());
                Thread.Sleep(100);
            }
        }
Exemple #6
0
        public void CustomersPolicyMemoryCache()
        {
            var query           = "select * from customers";
            var customerManager = new CustomersManager(new CustomersMemoryCache(), query);
            var categCnt        = 91;

            for (var i = 0; i < 10; i++)
            {
                Assert.AreEqual(categCnt, customerManager.GetCustomers().Count());
                Thread.Sleep(100);
            }
        }