示例#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();
 }
 /// <summary>
 /// Return single instance of connecter
 /// </summary>
 /// <param name="configuration"></param>
 /// <returns>The instance of connecter</returns>
 public static SQLiteConnecter GetInstance(IConfigurationSection configuration)
 {
     if (connecter == null)
     {
         connecter = new SQLiteConnecter(configuration);
     }
     return(connecter);
 }