public ActionResult Create() { ProductMangerViewModel viewModel = new ProductMangerViewModel(); viewModel.product = new Product(); viewModel.productCategeory = productcategories.collection(); return(View(viewModel)); }
public ActionResult Edit(string Id) { Product product = context.Find(Id); if (product == null) { return(HttpNotFound()); } else { ProductMangerViewModel viewModel = new ProductMangerViewModel(); viewModel.product = product; viewModel.productCategeory = productcategories.collection(); return(View(viewModel)); } }