Creating the Shopping Cart Project
Explore how to create a shopping cart project using Blazor WebAssembly. Learn to add and remove products, register a service with the AppState pattern to maintain cart state, and inject this service to prevent state loss across pages.
We'll cover the following...
We'll cover the following...
The ShoppingCart project will be created by using the Empty Blazor WebAssembly App project template. First, we will add logic to add and remove products from the shopping cart. Then, we will demonstrate that the cart's state is lost when we navigate between pages. To maintain the cart's state, we will register a service in the DI container that uses the AppState pattern. ...