Exemplo n.º 1
0
        private static void ProductTest()
        {
            ProductManager productmanager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            foreach (var p in productmanager.GetAll().Data)
            {
                Console.WriteLine(p.ProductName);
            }

            productmanager.GetAllByCagetoryId(2);
            productmanager.GetAllByUnitPrice(20, 35);

            var result = productmanager.GetProductDetails();

            if (result.Success == true)
            {
                foreach (var product in result.Data)
                {
                    Console.WriteLine(product.ProductName + "/" + product.CategoryName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }