Changing to database schema to ensure separations of concerns instead of connection string
This commit is contained in:
@@ -80,14 +80,17 @@ builder.Services.AddOpenApiDocument((configure, sp) =>
|
||||
|
||||
builder.Services.AddFastEndpoints();
|
||||
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection")
|
||||
?? throw new InvalidOperationException("Missing ConnectionStrings:DefaultConnection");
|
||||
|
||||
builder.Services.AddDbContext<MessagingDbContext>((_, options) =>
|
||||
{
|
||||
options.UseSqlServer(builder.Configuration.GetConnectionString("CommentStore"));
|
||||
options.UseSqlServer(connectionString);
|
||||
});
|
||||
|
||||
builder.Services.AddDbContext<ContentDbContext>((_, options) =>
|
||||
{
|
||||
options.UseSqlServer(builder.Configuration.GetConnectionString("ContentStore"));
|
||||
options.UseSqlServer(connectionString);
|
||||
});
|
||||
|
||||
builder.Services.Configure<JwtOptions>(builder.Configuration.GetRequiredSection(JwtOptions.SectionName));
|
||||
|
||||
Reference in New Issue
Block a user