From the course: Building a Web Application on Microsoft Azure
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Modifying the application to use the SQL EF provider - Azure Tutorial
From the course: Building a Web Application on Microsoft Azure
Modifying the application to use the SQL EF provider
- [Instructor] In its current state, this application is using an in-memory database. In other words, each time we execute the application, all the changes will be lost and that's not okay. That's why we need some kind of persistent storage such as Azure SQL database. That's why in this video we're going to change the code to use the SQL database that we just implemented. Okay, let me show you how. Here in the program.cs file, in line number seven, we have this method call that is AddInMemoryWpmDb. This is an extension method that I implemented. So if I show you the code, you can see that this is using memory database that comes from the in-memory provider of the Entity Framework Core. So luckily we have this other method that is AddWpmDb, and this other method uses the SQL Server provider for Entity Framework Core. However, this provider needs a connection string. In this case, the name of the connection string should be…