May 2026
Intermediate
598 pages
10h 39m
English
Blazor WebAssembly apps lose state on page navigation since everything runs in browser memory. Use dependency injection (DI) to register a service that persists state across components and survives navigation.
In this chapter, you will build a shopping cart. As you add and delete items from the shopping cart, the application will maintain a list of the items in the shopping cart. The contents of the shopping cart will be retained as you navigate between pages. Also, the shopping cart's running total will be displayed on all the pages.
DI holds the cart,
Pages turn, yet treasures stay.
Singleton's embrace.
In this chapter, I will cover the following topics:
Read now
Unlock full access