Dbcontext umbenannt. DIExtention für modelBuilder hinzugefügt, um OnModelCreating zu verwenden.

This commit is contained in:
Developer 02
2024-06-13 13:29:55 +02:00
parent d2dc116cd0
commit 8faed31baa
10 changed files with 71 additions and 57 deletions

View File

@@ -38,10 +38,6 @@ try {
options.LogoutPath = "/api/auth/logout";
});
builder.Services.AddDbContext<DDECMDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DD_ECM_Connection"))
.EnableDetailedErrors());
var allowedOrigins = builder.Configuration.GetSection("AllowedOrigins").Get<string[]>() ?? throw new InvalidOperationException("In appsettings there is no allowed origin.");
builder.Services.AddCors(options =>
@@ -57,7 +53,9 @@ try {
});
//builder.Services.AddAutoMapper(typeof(DirectoryMappingProfile).Assembly);
builder.Services.AddUserManager();
builder.Services.AddUserManager(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DD_ECM_Connection"))
.EnableDetailedErrors());
builder.Services.AddDirectorySearchService();