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:
Last but not least, we need to modify our ItemsController
to use the ApplicationDbContext
to retrieve data, getting rid of our dummy data provider once and for all.
In order to do that, the first thing we need to do is find an efficient way to map each Item entity to a corresponding ItemViewModel
object, as our new data provider won't generate them anymore. We can achieve such a result in a number of ways, including the following:
Adding a
Helper
method, such...