Esempio n. 1
0
 /// <summary>
 /// The constructor of APIConnection class
 /// </summary>
 /// <param name="mongoConfig">The config of mongo connecter</param>
 /// <param name="sqlConfig">The config of sql server connecter</param>
 /// <param name="sqliteConfig">The config of sqlite connecter</param>
 public APIConnection(IConfigurationSection mongoConfig, IConfigurationSection sqlConfig, IConfigurationSection sqliteConfig)
 {
     Mongo  = MongoConnecter.GetInstance(mongoConfig);
     SQL    = SQLConnecter.GetInstance(sqlConfig);
     SQLite = SQLiteConnecter.GetInstance(sqliteConfig);
     SQLite.OpenConnection();
 }
Esempio n. 2
0
 /// <summary>
 /// Return single instance of connecter
 /// </summary>
 /// <param name="configuration"></param>
 /// <returns>The instance of connecter</returns>
 public static SQLConnecter GetInstance(IConfigurationSection configuration)
 {
     if (connecter == null)
     {
         connecter = new SQLConnecter(configuration);
     }
     return(connecter);
 }