Seeding the database
We're now ready to seed our database. Since we hooked the DbSeeder.SeedAsync
to the Startup
class, it'll be as easy as hitting
F5
and letting the application work its magic. If we have done everything correctly, our database should be populated in no time. In order to check that, we can:
- Open the Server Object Explorer panel.
- Expand the nodes up to our
OpenGameList
database. - Right-click on the
dbo.Items
table and select View Data.
Upon doing that, we should see something like the following:
Updating the ItemsController
Last but not least, we need to modify our ItemsController
to use the ApplicationDbContext
to retrieve data, getting ...
Get ASP.NET Core: Cloud-ready, Enterprise Web Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.