From 552f90b424af85b19dd8f48645fb4018a44677cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Tue, 8 Jun 2021 17:03:59 +0200 Subject: [PATCH] add postgres support --- HanyadikHetVan/Startup.cs | 4 ++-- HanyadikHetVan/appsettings.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/HanyadikHetVan/Startup.cs b/HanyadikHetVan/Startup.cs index 29c4cba..a89e83a 100644 --- a/HanyadikHetVan/Startup.cs +++ b/HanyadikHetVan/Startup.cs @@ -33,8 +33,8 @@ namespace HanyadikHetVan public void ConfigureServices(IServiceCollection services) { services.AddDbContext(options => - options.UseSqlServer( - Configuration.GetConnectionString("DefaultConnection"))); + options.UseNpgsql( + Configuration.GetConnectionString("PostgreSQLConnection"))); services.AddAutoMapper(Assembly.GetExecutingAssembly()); services.AddTransient(); services.AddTransient(); diff --git a/HanyadikHetVan/appsettings.json b/HanyadikHetVan/appsettings.json index 54174b4..cd4ea64 100644 --- a/HanyadikHetVan/appsettings.json +++ b/HanyadikHetVan/appsettings.json @@ -1,7 +1,8 @@ { "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-HanyadikHetVan-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true" + "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-HanyadikHetVan-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true", + "PostgreSQLConnection": "User ID=hanyadikhetvan;Password=05acd81c-761a-4fb3-93ae-023281a88b73;Server=192.168.42.4;Port=5432;Database=hanyadikhetvan;Integrated Security=true;Pooling=true;" }, "DefaultAdministrator": { "UserName": "testuser",