public ActionResult Create() { ProductManagerViewModels viewModel = new ProductManagerViewModels(); viewModel.Product = new Product(); viewModel.ProductCategories = productCategories.Collection(); return(View(viewModel)); }
public ActionResult Edit(String Id) { Product product = context.Find(Id); if (product == null) { return(HttpNotFound()); } else { ProductManagerViewModels viewModel = new ProductManagerViewModels(); viewModel.Product = product; viewModel.ProductCategories = productCategories.Collection(); return(View(viewModel)); } }