connection string appsettings.json code example
Example 1: sql connection string in .net core
{
"ConnectionStrings": {
"BloggingDatabase": "Server=(localdb)\\mssqllocaldb;Database=EFGetStarted.ConsoleApp.NewDb;Trusted_Connection=True;"
},
}
Example 2: how to define connection string in appsettings.json
{
"Modules": {
"Logging": {
"logDb": "Server=myServer;Database=myDb1;Trusted_Connection=True;",
},
"Tenants": {
"tenantsDb": "Server=myServer;Database=myDb1;Trusted_Connection=True;",
}
}
}