feat(API): DB-Kontext zu den Diensten hinzugefügt

This commit is contained in:
Developer 02 2024-10-24 20:02:16 +02:00
parent 0351f8733d
commit 70d7ed7415
2 changed files with 13 additions and 2 deletions

View File

@ -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<UserManagerDbContext>(options => options.UseSqlServer(cnn_str).EnableDetailedErrors());
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle

View File

@ -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;"
}
}