Commit 5d1c8ddf authored by Krishna Reddy Tamatam's avatar Krishna Reddy Tamatam

Merge branch 'master' into production

# Conflicts:
#	Program.cs
#	appsettings.json
parents 4dba9096 39af2a52
This diff is collapsed.
...@@ -18,6 +18,8 @@ namespace FTP_Services.Services ...@@ -18,6 +18,8 @@ namespace FTP_Services.Services
#region Variables #region Variables
protected PetaPoco.Database _repository; protected PetaPoco.Database _repository;
protected PetaPoco.Database _adminRepository; protected PetaPoco.Database _adminRepository;
protected PetaPoco.Database _mrdRepository;
//protected IConfiguration _configuration; //protected IConfiguration _configuration;
protected AppSettings _appSettings; protected AppSettings _appSettings;
protected readonly log4net.ILog log = log4net.LogManager.GetLogger("BaseDataAdapter"); protected readonly log4net.ILog log = log4net.LogManager.GetLogger("BaseDataAdapter");
...@@ -28,18 +30,24 @@ namespace FTP_Services.Services ...@@ -28,18 +30,24 @@ namespace FTP_Services.Services
{ {
log.Debug("BaseDataAdapter() called"); log.Debug("BaseDataAdapter() called");
this._appSettings = appSettings; this._appSettings = appSettings;
string constr = _appSettings.ConnectionString; string constr = _appSettings.ConnectionString;
log.Debug("Connection String -" + constr); log.Debug("Connection String -" + constr);
_auth_user_id=0; _auth_user_id=0;
_user_id=0; _user_id=0;
_repository = new PetaPoco.Database(constr, "npgsql"); _repository = new PetaPoco.Database(constr, "npgsql");
string Adminconstr = _appSettings.AdminConnectionString; string Adminconstr = _appSettings.AdminConnectionString;
log.Debug("Connection String -" + constr); log.Debug("Admin Connection String -" + Adminconstr);
_auth_user_id=0; _auth_user_id=0;
_user_id=0; _user_id=0;
_repository = new PetaPoco.Database(Adminconstr, "npgsql"); _adminRepository = new PetaPoco.Database(Adminconstr, "npgsql");
string MRDConstr = _appSettings.ConnectionString_MRD;
log.Debug("MRD Connection String -" + MRDConstr);
_auth_user_id=0;
_user_id=0;
_mrdRepository = new PetaPoco.Database(MRDConstr, "npgsql");
} }
public void Dispose() public void Dispose()
...@@ -47,6 +55,14 @@ namespace FTP_Services.Services ...@@ -47,6 +55,14 @@ namespace FTP_Services.Services
if(this._repository.Connection!=null) if(this._repository.Connection!=null)
this._repository.Connection.Close(); this._repository.Connection.Close();
this._repository.Dispose(); this._repository.Dispose();
if(this._adminRepository.Connection!=null)
this._adminRepository.Connection.Close();
this._adminRepository.Dispose();
if(this._mrdRepository.Connection!=null)
this._mrdRepository.Connection.Close();
this._mrdRepository.Dispose();
} }
} }
} }
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment