예제 #1
0
        public void MemoryCacheTest()
        {
            var employeeManager = new EmployeesManager(new EmployeesMemoryCache());

            /*for (var i = 0; i < 10; i++)
             * {
             *      Console.WriteLine(employeeManager.GetEmployee().Count());
             *      Thread.Sleep(100);
             * }
             *
             * var ordersManager = new OrderManager(new OrdersMemoryCache());
             *
             * for (var i = 0; i < 10; i++)
             * {
             *      Console.WriteLine(ordersManager.GetOrders().Count());
             *      Thread.Sleep(100);
             * }
             */
            var categoryManager = new CategoriesManager(new CategoriesMemoryCache());

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(categoryManager.GetCategories().Count());
                Thread.Sleep(100);
            }
        }
예제 #2
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 employeeManager = new EmployeesManager(new EmployeesRedisCache("localhost"));

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

            var ordersManager = new OrderManager(new OrdersRedisCache("localhost"));

            for (var i = 0; i < 10; i++)
            {
                Console.WriteLine(ordersManager.GetOrders().Count());
                Thread.Sleep(100);
            }
        }
예제 #3
0
        public void MemoryCacheEmployee()
        {
            var employeeManager = new EmployeesManager(new EmployeesMemoryCache());

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