Exemplo n.º 1
0
        public ActionResult Create(ProductViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return View(viewModel);
            }
            Product product = new Product();
            product.Date = DateTime.UtcNow;
            product.CopyFrom(viewModel);
            daoTemplate.Save(product);

            handleImages(product);

            return RedirectToAction("Edit", new {Id = product.Id});
        }