From 8137b1ca6a783392995abbe43367bdef05535556 Mon Sep 17 00:00:00 2001 From: "t.ruspekhofer" Date: Sun, 27 Feb 2022 20:07:57 +0100 Subject: [PATCH] changed to Pomelo.EntityFrameworkCore.MySql for release version --- Lieb/.config/dotnet-tools.json | 12 ++++++++++++ Lieb/Lieb.csproj | 3 ++- Lieb/Program.cs | 2 +- Lieb/appsettings.Development.json | 4 ++++ Lieb/appsettings.json | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 Lieb/.config/dotnet-tools.json diff --git a/Lieb/.config/dotnet-tools.json b/Lieb/.config/dotnet-tools.json new file mode 100644 index 0000000..82e7e22 --- /dev/null +++ b/Lieb/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "6.0.2", + "commands": [ + "dotnet-ef" + ] + } + } +} \ No newline at end of file diff --git a/Lieb/Lieb.csproj b/Lieb/Lieb.csproj index e138465..2246e27 100644 --- a/Lieb/Lieb.csproj +++ b/Lieb/Lieb.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -14,6 +14,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Lieb/Program.cs b/Lieb/Program.cs index cba458b..e6a1e45 100644 --- a/Lieb/Program.cs +++ b/Lieb/Program.cs @@ -13,7 +13,7 @@ builder.Services.AddDbContextFactory(opt => opt.UseSqlServer(builder.Configuration.GetConnectionString("LiebContext")).EnableSensitiveDataLogging(), ServiceLifetime.Transient); #else builder.Services.AddDbContextFactory(opt => - opt.UseSqlServer(builder.Configuration.GetConnectionString("LiebContext")), ServiceLifetime.Transient); + opt.UseMySql(builder.Configuration.GetConnectionString("LiebContext"), ServerVersion.AutoDetect(builder.Configuration.GetConnectionString("LiebContext"))), ServiceLifetime.Transient); #endif builder.Services.AddDatabaseDeveloperPageExceptionFilter(); diff --git a/Lieb/appsettings.Development.json b/Lieb/appsettings.Development.json index 770d3e9..96313d9 100644 --- a/Lieb/appsettings.Development.json +++ b/Lieb/appsettings.Development.json @@ -5,5 +5,9 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "LiebContext": "Server=(localdb)\\mssqllocaldb;Database=LiebContext-f9dae0eb-8d5c-495d-ab99-da7951e0638b;Trusted_Connection=True;MultipleActiveResultSets=true" } } diff --git a/Lieb/appsettings.json b/Lieb/appsettings.json index 2731b61..f2ad13a 100644 --- a/Lieb/appsettings.json +++ b/Lieb/appsettings.json @@ -11,6 +11,6 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "LiebContext": "Server=(localdb)\\mssqllocaldb;Database=LiebContext-f9dae0eb-8d5c-495d-ab99-da7951e0638b;Trusted_Connection=True;MultipleActiveResultSets=true" + "LiebContext": "Server=liebdb;Database=LiebContext;Uid=root;Pwd=my-secret-pw;" } } \ No newline at end of file