Refactor DIExtensions.AddUserManager to Use Generic TDbContext for Improved Flexibility.
This commit is contained in:
@@ -38,6 +38,10 @@ try {
|
||||
options.LogoutPath = "/api/auth/logout";
|
||||
});
|
||||
|
||||
builder.Services.AddDbContext<UserManagerDbContext>(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 =>
|
||||
@@ -53,9 +57,7 @@ try {
|
||||
});
|
||||
|
||||
//builder.Services.AddAutoMapper(typeof(DirectoryMappingProfile).Assembly);
|
||||
builder.Services.AddUserManager(options =>
|
||||
options.UseSqlServer(builder.Configuration.GetConnectionString("DD_ECM_Connection"))
|
||||
.EnableDetailedErrors());
|
||||
builder.Services.AddUserManager<UserManagerDbContext>();
|
||||
|
||||
builder.Services.AddDirectorySearchService();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user