public ActionResult Create() { ProductManagerViewModel viewModel = new ProductManagerViewModel(); viewModel.Product = new Product(); viewModel.Productcategories = productCategories.Collection(); return(View(viewModel)); }
public ActionResult Index(string category = null) { List <Product> products; List <ProductCategory> categories = productCategories.Collection().ToList(); if (category == null) { products = context.Collection().ToList(); } else { products = context.Collection().Where(p => p.Category == category).ToList(); } ProductListViewModel model = new ProductListViewModel(); model.Products = products; model.Productcategories = categories; return(View(model)); }
// GET: ProductManager public ActionResult Index() { List <Product> products = context.Collection().ToList(); return(View(products)); }
// GET: ProductManager public ActionResult Index() { List <ProductCategory> productCategory = context.Collection().ToList(); return(View(productCategory)); }