I am currently working on the Apress ASP.NET MVC2 book and I am a bit confused about the user new {returnUrl} in the following code:
public RedirectToRouteResult RemoveFromCart(Cart cart, int productID, string returnUrl)
{
Product product = productsRepository.Products.FirstOrDefault(p => p.ProductID == productID);
cart.RemoveLine(product);
return RedirectToAction("Index", new { returnUrl });
}
Is this somehow related to creating a new line, and not just passing a reference to the parameter passed to?
source
share