Example #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"));
 }
Example #2
0
        public void OrdersMemoryCache()
        {
            var ordersManager = new OrdersManager(new OrdersMemoryCache(), new OrderCachePolicy());

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(ordersManager.GetOrders().Count());
                Thread.Sleep(100);
            }
        }
Example #3
0
        public void RedisCache()
        {
            var categoryManager = new CategoriesManager(new CategoriesRedisCache("localhost"));

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(categoryManager.GetCategories().Count());
                Thread.Sleep(100);
            }

            var orderManager = new OrdersManager(new OrdersRedisCache("localhost"));

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(orderManager.GetOrders().Count());
                Thread.Sleep(100);
            }
        }