Pass in sql connection configuration
This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -9,7 +9,7 @@
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
"program": "${workspaceFolder}GerbilManagerWebAPI/bin/Debug/net7.0/GerbilManager.dll",
|
||||
"program": "${workspaceFolder}/GerbilManagerWebAPI/bin/Debug/net7.0/GerbilManagerWebAPI.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/GerbilManagerWebAPI",
|
||||
"stopAtEntry": false,
|
||||
|
||||
@@ -12,7 +12,7 @@ builder.Services.AddSwaggerGen();
|
||||
|
||||
builder.Services.AddSingleton<IGerbilRepository, InMemGerbilRepository>();
|
||||
|
||||
builder.Services.AddDbContext<ApplicationContext>(opts => opts.UseSqlServer(Configuration.GetConnectionString("sqlConnection")));
|
||||
builder.Services.AddDbContext<ApplicationContext>(opts => opts.UseSqlServer(builder.Configuration.GetConnectionString("sqlConnection")));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user