Adding a SQL Server connection string

Now that the SQL Server Database has been set up, we need to tell our application to use it instead of localDb while in production. We can easily do that by leveraging the ASP.NET Core default pattern for configuring application behavior across multiple environments.

To implement it within our project, we need to perform the following steps:

  1. Copy the existing connection string from the appsettings.json file to the appsettings.Development.json file so that we'll still be able to connect to the localDb instance when we run the project in debug/development mode. Then, replace the appsettings.json connection string with a new one, pointing to the new SQL Server instance so that the web app will connect there ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.