May 24, 2011 at 6:17 AM
Edited May 24, 2011 at 6:19 AM
Working through all 135 pages of the tutorial in detail.
Was going great until I got to section 8.
Please go to the shopping cart class.
Due to the my lack of expereince with the subject, I can't understand the purpose of the helper method below.
Also, not clear on the two GetCart methods. I know they are overridden with different signatures, it is just not registering with me why.
Can someone help my old brain.
This text does not seem to be enough for it to gel with me:
GetCart is a static method which allows our controllers to obtain a cart object. It uses the
GetCartId method to handle reading the CartId from the user’s session. The GetCartId method requires the HttpContextBase so that it can read the user’s CartId from user’s session.
public static ShoppingCart GetCart(HttpContextBase context)
var cart = new ShoppingCart();
cart.ShoppingCartId = cart.GetCartId(context);
// Helper method to simplify shopping cart calls
public static ShoppingCart GetCart(Controller controller)