An Introduction to ASP.NET Core MVC through an Example (Part 5)
Briefly

The MySessionCart class subclasses the MyCart class and overrides the AddItem, RemoveLine, and Clear methods to call their base implementations and then store the updated state in the session by using extension methods on the ISession interface.
The static GetCart method is to create MySessionCart objects and provide them with an ISession object so they can store themselves.
Read at CodeProject
[
add
]
[
|
|
]