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); }
public ActionResult Categories() { NorthwindDb db = new NorthwindDb(connectionString); IEnumerable<Category> categories = db.GetAll(); return View(categories); }