public DatasourceRepository(DbConnection dbConn, ORManager orm, IGetDatasourcesMapper getDatasourcesMapper) { _dbConn = dbConn; _orm = orm; _getDatasourcesMapper = getDatasourcesMapper; }
/// <summary> /// Creates and prepares a <see cref="Database"/> object that /// is ready to interact with the specified database. /// </summary> /// <remarks> /// WARNING: There is no support for multiple NHibernate connections. The connection /// string that is used first will be the one that is used to create the NHibernate /// session factory. /// </remarks> /// <param name="connectionString"> /// The full connection string that can be used to connect to /// the database. /// </param> public static Database GetDbConnectionFromConnectionString(string connectionString) { Database db; DbConnection dbConn; lock (_orManagerLocker) { if (_orManager == null) { _orManager = new ORManager(connectionString, new Assembly[] { typeof(ConfiguredDatasource).Assembly }); } } dbConn = new DbConnection(connectionString); db = new Database(dbConn, _orManager); return(db); }
/// <summary> /// Creates a new instance of the <see cref="Database"/> class. /// </summary> /// <param name="dbConn"></param> public Database(YTech.Db.SqlServer.DbConnection dbConn, ORManager orDBConn) { _dbConn = dbConn; _orDBConn = orDBConn; }