From the course: Advanced ASP.NET Web API 2.2
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Setting up a database
From the course: Advanced ASP.NET Web API 2.2
Setting up a database
- [Instructor] Now that we have set up the OData controller and the appdb context file, we can learn how to manipulate data. But before we do that, we need to set up the database using the Entity Framework. To set up the database using the Entity Framework, we are going to first enable migrations, then next, we are going to add a migration and at the end, we are going to apply a migration. So let us go to Visual Studio and see that in action. In here before we started as set the OData project as the startup project and then next, go to the Package Manager Console. Here, let us write Enable-Migrations. And we are getting an error which says that the EntityFramework package is not installed in the WebApi.DI. And that's right because we not working on the DI project, we are working on the OData project. So let us change the default project in here to the WebApi.OData and execute this command one more time. Now, before we…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Setting up the environment4m 36s
-
(Locked)
Configuring the OData endpoint3m 25s
-
(Locked)
Creating the first OData controller2m 2s
-
(Locked)
Setting up a database4m 4s
-
(Locked)
Reading entities4m 39s
-
(Locked)
Creating and reading a single entity3m 37s
-
(Locked)
Updating and deleting an entity7m 4s
-
(Locked)
-
-
-