public ActionResult Create(Product product) { var newProductId = idGenerator.NewId(); product.Id = newProductId; commandService.AddProduct(product); return(this.Url.Link("Default", new { Controller = "Product", Action = "GetProduct", id = newProductId })); }
public ActionResult Create(Product product) { var newProductId = idGenerator.NewId(); product.Id = newProductId; commandService.AddProduct(product); //TODO: add url parameter or TempData key to show "product created" message if needed return(RedirectToAction("GetProduct", new { id = newProductId })); }