© Adam Freeman 2017

Adam Freeman, Pro ASP.NET Core MVC 2, https://doi.org/10.1007/978-1-4842-3150-0_10

10. SportsStore: Completing the Cart

Adam Freeman

(1)London, UK

In this chapter, I continue to build the SportsStore example app. In the previous chapter, I added the basic support for a shopping cart, and now I am going to improve on and complete that functionality.

Refining the Cart Model with a Service

I defined a Cart model class in the previous chapter and demonstrated how it can be stored using the session feature, allowing the user to build up a set of products for purchase. The responsibility for managing the persistence of the Cart class fell to the Cart controller, which explicitly defines methods for getting and storing Cart objects. ...

Get Pro ASP.NET Core MVC 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.