Пример #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"));
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
        public void MemoryCacheCustomers()
        {
            var customerManager = new CustomersManager(new CustomersMemoryCache());

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(customerManager.GetCustomers().Count());
                Thread.Sleep(100);
            }
        }
Пример #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);
            }
        }
Пример #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);
            }
        }
Пример #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);
            }
        }