From the course: Building Angular and ASP.NET Web API Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Configuring DbContext

Configuring DbContext

From the course: Building Angular and ASP.NET Web API Apps

Start my 1-month free trial

Configuring DbContext

- [Narrator] Once you have a model, the primary class your application interacts with, is the DbContext class, which is often referred to as the context class. You can use the DbContext associated to a model, to write and execute queries, to materialize query results as entity objects, to track changes that are made to those objects, to persist object changes back to the database, and bind objects in memory to UI controls. During this course, we are going to use entity framework, to work with data, and in order to use entity framework, to query, insert, update, and delete data, using the dot net objects, we first need to create a model, which maps the entities and relationships that are defined in your model to tables in a database. And we have already created a model, when we created the entry class. So first thing first, let us start by creating a data layer which will be used to work with data. Let us create the context class, or the context file, which we are going to name the app…

Contents