From 5ce3f660278e560d56d0cac23d79974baa1394d9 Mon Sep 17 00:00:00 2001 From: "Daniel Mackay [SSW]" <2636640+danielmackay@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:37:56 +1000 Subject: [PATCH 1/2] Add option of both local DB and docker DB --- src/WebApi/appsettings.Development.json | 3 --- src/WebApi/appsettings.json | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/WebApi/appsettings.Development.json b/src/WebApi/appsettings.Development.json index 17d39174..0c208ae9 100644 --- a/src/WebApi/appsettings.Development.json +++ b/src/WebApi/appsettings.Development.json @@ -4,8 +4,5 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } - }, - "ConnectionStrings": { - "DefaultConnection": "<< you can also set this with dotnet user-secrets >>" } } diff --git a/src/WebApi/appsettings.json b/src/WebApi/appsettings.json index 1617e16e..309f25f3 100644 --- a/src/WebApi/appsettings.json +++ b/src/WebApi/appsettings.json @@ -5,8 +5,12 @@ "Microsoft.AspNetCore": "Warning" } }, + // NOTE: If any of your connection strings real passwords, you should delete them and put them in the user secrets file instead. "ConnectionStrings": { - "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=CleanArchitecture;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + // Local DB + //"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=CleanArchitecture;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + // Docker DB + "DefaultConnection": "Server=localhost,1433;Initial Catalog=CleanArchitecture;Persist Security Info=False;User ID=sa;Password=yourStrong(!)Password;MultipleActiveResultSets=True;TrustServerCertificate=True;Connection Timeout=30;" }, "AllowedHosts": "*" } From 23c68bb45a9e0334806fb7f890c4be931a5ca1f9 Mon Sep 17 00:00:00 2001 From: "Daniel Mackay [SSW]" <2636640+danielmackay@users.noreply.github.com> Date: Fri, 11 Aug 2023 14:43:01 +1000 Subject: [PATCH 2/2] Moved connection strings to development settings. --- src/WebApi/appsettings.Development.json | 7 +++++++ src/WebApi/appsettings.json | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/WebApi/appsettings.Development.json b/src/WebApi/appsettings.Development.json index 0c208ae9..9c3f7079 100644 --- a/src/WebApi/appsettings.Development.json +++ b/src/WebApi/appsettings.Development.json @@ -4,5 +4,12 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + // NOTE: If any of your connection strings real passwords, you should delete them and put them in the user secrets file instead. + "ConnectionStrings": { + // Local DB + "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=CleanArchitecture;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + // Docker DB + //"DefaultConnection": "Server=localhost,1433;Initial Catalog=CleanArchitecture;Persist Security Info=False;User ID=sa;Password=yourStrong(!)Password;MultipleActiveResultSets=True;TrustServerCertificate=True;Connection Timeout=30;" } } diff --git a/src/WebApi/appsettings.json b/src/WebApi/appsettings.json index 309f25f3..ec04bc12 100644 --- a/src/WebApi/appsettings.json +++ b/src/WebApi/appsettings.json @@ -5,12 +5,5 @@ "Microsoft.AspNetCore": "Warning" } }, - // NOTE: If any of your connection strings real passwords, you should delete them and put them in the user secrets file instead. - "ConnectionStrings": { - // Local DB - //"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=CleanArchitecture;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" - // Docker DB - "DefaultConnection": "Server=localhost,1433;Initial Catalog=CleanArchitecture;Persist Security Info=False;User ID=sa;Password=yourStrong(!)Password;MultipleActiveResultSets=True;TrustServerCertificate=True;Connection Timeout=30;" - }, "AllowedHosts": "*" -} +} \ No newline at end of file