Commit 39af2a52 authored by Krishna Reddy Tamatam's avatar Krishna Reddy Tamatam

Added one more adapter.

parent f2b0d1db
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");
...@@ -36,10 +38,16 @@ namespace FTP_Services.Services ...@@ -36,10 +38,16 @@ namespace FTP_Services.Services
_repository = new PetaPoco.Database(constr, "npgsql"); _repository = new PetaPoco.Database(constr, "npgsql");
string Adminconstr = _appSettings.AdminConnectionString; string Adminconstr = _appSettings.AdminConnectionString;
log.Debug("Connection String -" + Adminconstr); log.Debug("Admin Connection String -" + Adminconstr);
_auth_user_id=0; _auth_user_id=0;
_user_id=0; _user_id=0;
_adminRepository = 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()
...@@ -51,6 +59,10 @@ namespace FTP_Services.Services ...@@ -51,6 +59,10 @@ namespace FTP_Services.Services
if(this._adminRepository.Connection!=null) if(this._adminRepository.Connection!=null)
this._adminRepository.Connection.Close(); this._adminRepository.Connection.Close();
this._adminRepository.Dispose(); 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