2021年3月25日星期四

.NET Core console application, where is the connection string stored

Inside Visual Studio 2019 I have created a .NET Core console application. Then I use the below command to map existing database -

PM> Scaffold-DbContext "Server=.\MSSQL;Database=SchoolDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models  

The above command mapped all the tables inside the SchoolDB database. But I have the following question -

  1. inside my asp.net core web application, where is the connection string saved? So I can change it when I move my console application from test to the live environment.

Here is how my console application looks like after running the above command, where I can not find any configuration file to store the connection string -

enter image description here

https://stackoverflow.com/questions/66809025/net-core-console-application-where-is-the-connection-string-stored March 26, 2021 at 07:36AM

没有评论:

发表评论