Building a Blazor data component
In this section, we will build a component to list, create, and edit employees in the Northwind database.
We will build it over several steps:
- Make a Blazor component that renders the name of an employee set as a parameter.
- Make it work as a routable page as well as a component.
- Implement the functionality to perform CRUD operations on employees in a database.
- Build and call a Minimal API web service.
We will add the new component to the existing Blazor WebAssembly client project:
- In the
Northwind.BlazorWasm.Client
project, in thePages
folder, add a new file namedEmployees.razor
. In Visual Studio, the project item template is named Razor Component. - Add statements to output a heading for the
Employees
component and define a code block that defines a property to store the name of a country, as shown highlighted in the following markup:<h3>Employees @(string.IsNullOrWhiteSpace...