Pulled connection string out to appsettings.json file.
This commit is contained in:
@ -8,7 +8,13 @@ namespace ReportingServices.Dependency_Injections
|
|||||||
public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
|
public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
|
||||||
{
|
{
|
||||||
private SqlConnection _connection;
|
private SqlConnection _connection;
|
||||||
private string _connectionString = "Server=Messv01ec.ec.local\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true";
|
private string _connectionString;
|
||||||
|
|
||||||
|
public ScrapeDatabaseRepository()
|
||||||
|
{
|
||||||
|
IConfiguration configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
|
||||||
|
_connectionString = configuration.GetConnectionString("DefaultConnection");
|
||||||
|
}
|
||||||
|
|
||||||
public void OpenConnection()
|
public void OpenConnection()
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using ReportingServices.Dependency_Injections;
|
using ReportingServices.Dependency_Injections;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=Messv01ec.ec.local\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true"
|
||||||
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"Using": [
|
"Using": [
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user