From 3aa11ac2dcae3e43ef7d6176cade705a5b7d2d1c Mon Sep 17 00:00:00 2001 From: VictoriaPresnyakova Date: Thu, 4 May 2023 21:53:02 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=8B=D0=BD=D0=B5=D1=81=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BusinessLogic/BusinessLogic.csproj | 4 ++++ TransportGuide/App.config | 6 ++++++ TransportGuide/TransportGuide.csproj | 1 + TransportGuideContracts/TransportGuideContracts.csproj | 4 ++++ TransportGuideDataModels/TransportGuideDataModels.csproj | 1 + TransportGuideDatabaseImplements/TransportGuideDB.cs | 5 ++++- .../TransportGuideDatabaseImplements.csproj | 1 + 7 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 TransportGuide/App.config diff --git a/BusinessLogic/BusinessLogic.csproj b/BusinessLogic/BusinessLogic.csproj index 0b64d35..c307385 100644 --- a/BusinessLogic/BusinessLogic.csproj +++ b/BusinessLogic/BusinessLogic.csproj @@ -6,6 +6,10 @@ enable + + + + diff --git a/TransportGuide/App.config b/TransportGuide/App.config new file mode 100644 index 0000000..e4f720d --- /dev/null +++ b/TransportGuide/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TransportGuide/TransportGuide.csproj b/TransportGuide/TransportGuide.csproj index 571db5b..b38c828 100644 --- a/TransportGuide/TransportGuide.csproj +++ b/TransportGuide/TransportGuide.csproj @@ -14,6 +14,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/TransportGuideContracts/TransportGuideContracts.csproj b/TransportGuideContracts/TransportGuideContracts.csproj index 0e60d27..f8148fd 100644 --- a/TransportGuideContracts/TransportGuideContracts.csproj +++ b/TransportGuideContracts/TransportGuideContracts.csproj @@ -6,6 +6,10 @@ enable + + + + diff --git a/TransportGuideDataModels/TransportGuideDataModels.csproj b/TransportGuideDataModels/TransportGuideDataModels.csproj index e3cec15..17c1974 100644 --- a/TransportGuideDataModels/TransportGuideDataModels.csproj +++ b/TransportGuideDataModels/TransportGuideDataModels.csproj @@ -8,6 +8,7 @@ + diff --git a/TransportGuideDatabaseImplements/TransportGuideDB.cs b/TransportGuideDatabaseImplements/TransportGuideDB.cs index f47871f..fbbdc98 100644 --- a/TransportGuideDatabaseImplements/TransportGuideDB.cs +++ b/TransportGuideDatabaseImplements/TransportGuideDB.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Configuration; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,12 +12,14 @@ namespace TransportGuideDatabaseImplements { public class TransportGuideDB : DbContext { + string dbName = ConfigurationManager.AppSettings["connectToDb"]; + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseNpgsql("Host=192.168.56.101;Port=5432;Database=TransportSubd;Username=postgres;Password=1502"); + optionsBuilder.UseNpgsql(dbName); } base.OnConfiguring(optionsBuilder); } diff --git a/TransportGuideDatabaseImplements/TransportGuideDatabaseImplements.csproj b/TransportGuideDatabaseImplements/TransportGuideDatabaseImplements.csproj index 609bab5..3781eda 100644 --- a/TransportGuideDatabaseImplements/TransportGuideDatabaseImplements.csproj +++ b/TransportGuideDatabaseImplements/TransportGuideDatabaseImplements.csproj @@ -13,6 +13,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive +