From 70d7ed7415cde5257704810059ac05d8feed5bd5 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 24 Oct 2024 20:02:16 +0200 Subject: [PATCH] =?UTF-8?q?feat(API):=20DB-Kontext=20zu=20den=20Diensten?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WorkFlow.API/Program.cs | 8 ++++++++ WorkFlow.API/appsettings.json | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/WorkFlow.API/Program.cs b/WorkFlow.API/Program.cs index 8264bac..7f000ef 100644 --- a/WorkFlow.API/Program.cs +++ b/WorkFlow.API/Program.cs @@ -1,6 +1,14 @@ +using WorkFlow.Application; +using DigitalData.UserManager.Application; +using DigitalData.UserManager.Infrastructure.Repositories; +using Microsoft.EntityFrameworkCore; + var builder = WebApplication.CreateBuilder(args); +var config = builder.Configuration; // Add services to the container. +var cnn_str = config.GetConnectionString("Default") ?? throw new ArgumentNullException("Default connection string not found."); +builder.Services.AddDbContext(options => options.UseSqlServer(cnn_str).EnableDetailedErrors()); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle diff --git a/WorkFlow.API/appsettings.json b/WorkFlow.API/appsettings.json index 10f68b8..a78d677 100644 --- a/WorkFlow.API/appsettings.json +++ b/WorkFlow.API/appsettings.json @@ -5,5 +5,8 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" -} + "AllowedHosts": "*", + "ConnectionStrings": { + "Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=g+2edXEbMbujCUjh7INZRQ==;Password=Bz/n9pu8EyzlVqicaMRQGQ==;Encrypt=false;TrustServerCertificate=True;" + } +} \ No newline at end of file