예제 #1
0
        public ActionResult Products(int catid)
        {
            NorthwindDb           db        = new NorthwindDb(connectionString);
            Category              category  = db.GetCategoryById(catid);
            IEnumerable <Product> products  = db.GetProductsForCategory(catid);
            ProductsViewModel     viewModel = new ProductsViewModel();

            viewModel.Products = products;
            viewModel.Category = category;
            return(View(viewModel));
        }