edit connection
This commit is contained in:
parent
54d8deec37
commit
394edfd02f
6 changed files with 38 additions and 39 deletions
|
|
@ -64,13 +64,13 @@ builder.Host.UseSerilog();
|
|||
// Register DbContext
|
||||
var examConnection = builder.Configuration.GetConnectionString("ExamConnection");
|
||||
builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
||||
options.UseMySql(examConnection, ServerVersion.AutoDetect(examConnection)));
|
||||
options.UseMySql(examConnection, ServerVersion.AutoDetect(examConnection)), ServiceLifetime.Transient);
|
||||
var orgConnection = builder.Configuration.GetConnectionString("OrgConnection");
|
||||
builder.Services.AddDbContext<OrgDbContext>(options =>
|
||||
options.UseMySql(orgConnection, ServerVersion.AutoDetect(orgConnection)));
|
||||
options.UseMySql(orgConnection, ServerVersion.AutoDetect(orgConnection)), ServiceLifetime.Transient);
|
||||
var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
builder.Services.AddDbContext<MetadataDbContext>(options =>
|
||||
options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection)));
|
||||
options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection)), ServiceLifetime.Transient);
|
||||
|
||||
// Add config CORS
|
||||
builder.Services.AddCors(options => options.AddDefaultPolicy(builder =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue