June 2017
Intermediate to advanced
1083 pages
22h 12m
English
To interact with data as objects/entity classes, EF uses the Microsoft.EntityFrameworkCore.DbContext class also called DbContext or simply Context. This class is in charge of all the entity objects during execution, including populating them with data from the database, keeping track of changes, and persisting them to the database during CRUD operations.
We can easily create our very own DbContext class for our project, which we will call ApplicationDbContext, by performing the following tasks:
Right-click on the /OpenGameList/Data folder and add a new ApplicationDbContext.cs class. Fill it up with the following code:
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; ...
Read now
Unlock full access