public ViewResult EditProduct(int productId)
        {
            IEnumerable<Category>  categoryList = repository.Categories;
            Product product = repository.Products.FirstOrDefault(p => p.ProductID == productId);

            ProductEditViewModel viewModel = new ProductEditViewModel() {
                ProductID = product.ProductID,
                Name = product.Name,
                SelectedCategoryID = product.CategoryID,
                Price = product.Price,
                Description = product.Description,
                Categories = categoryList
            };

            return View(viewModel);
        }
        public ActionResult EditProduct(ProductEditViewModel productViewModel)
        {
            if (ModelState.IsValid)
            {
                repository.SaveProduct(productViewModel.ToDomainProduct());
                TempData["message"] = string.Format("{0} has been saved", productViewModel.Name);
                return RedirectToAction("Products");
            }
            else
            {
                IEnumerable<Category> categoryList = repository.Categories;
                productViewModel.Categories = categoryList;

                // there is something wrong with the data values
                return View(productViewModel);
            }
        }