Getting Entities into a Component

Learn about fetching data from the Northwind database, and implementing a component to display customer information.

Fetch data from the database

Now that we have seen the minimum implementation of a component, we can add some useful functionality to it. In this case, we will use the Northwind database context to fetch customers from the database:

Step 1: In Northwind.BlazorServer.csproj, add a reference to the Northwind database context project for either SQL Server or SQLite, as shown in the following markup:

Get hands-on with 1400+ tech skills courses.