public ActionResult Create() { ProductmanagerViewModel viewModel = new ProductmanagerViewModel(); 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 { ProductmanagerViewModel viewModel = new ProductmanagerViewModel(); viewModel.Product = product; viewModel.ProductCategories = productCategories.Collection(); return(View(viewModel)); } }