Building components using Blazor
We will build it over several steps:
- Make a Blazor component that renders the name of a country set as a parameter.
- Make it work as a routable page as well as a component.
- Implement the functionality to perform CRUD operations on customers in a database.
Defining and testing a simple Blazor component
- In the
Northwind.Blazorproject, in the
Components\Pagesfolder, add a new file named
Customers.razor. In Visual Studio 2022, the project item template is named Razor Component. In JetBrains Rider, the project item template is named Blazor Component.
Good Practice: Blazor component filenames must start with an uppercase letter, or you will have compile errors!
- Add statements to output a heading for...