private DbTable GetTableObject(int index, string tableObject) { DbTable dbTable = null; if (tableObject.CompareTo("PaperVersion") == 0) { dbTable = mDatabasePool.GetDatabase(index).PaperVersionTable; } else if (tableObject.CompareTo("FileType") == 0) { dbTable = mDatabasePool.GetDatabase(index).FileTypeTable; } else if (tableObject.CompareTo("BankaTable") == 0) { dbTable = mDatabasePool.GetDatabase(index).bankaTable; } return(dbTable); }
/// <summary> /// Returns the default insert artefact engine for <typeparamref name="T"/> /// </summary> /// <param name="connectionStringSettings"> /// The connection string settings. /// </param> /// <typeparam name="T"> /// The <see cref="IMaintainableObject"/> based type. /// </typeparam> /// <returns> /// The <see cref="IImportEngine{T}"/>. /// </returns> public static IImportEngine <T> GetArtefactEngine <T>(ConnectionStringSettings connectionStringSettings) where T : IMaintainableObject { Func <Database, object> engine; if (_artefactEngines.TryGetValue(typeof(T), out engine)) { var database = DatabasePool.GetDatabase(connectionStringSettings); return(engine(database) as IImportEngine <T>); } return(null); }
public QuerySetPool(DatabasePool databasePool) { mDatabasePool = databasePool; mTableObjects = new DbTable[databasePool.Count()]; mQuerySets = new QuerySet[databasePool.Count()]; for (int i = 0; i < databasePool.Count(); i++) { mQuerySets[i] = new QuerySet(databasePool.GetDatabase(i)); } mQueryMethods = new Collection <MethodInfo>(); mMethodParameters = new Collection <Type[]>(); mQueryNumbers = new Collection <int>(); mQueryMaximalNumbers = new Collection <int>(); }
/// <summary> /// Initializes a new instance of the <see cref="MappingStoreManager"/> class. /// </summary> /// <param name="connectionStringSettings"> /// The connection string settings. /// </param> /// <param name="factories"> /// The factories. /// </param> /// <param name="artefactImportStatuses"> /// The artefact import statuses. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="connectionStringSettings"/> is null /// -or- /// <paramref name="artefactImportStatuses"/> is null /// </exception> public MappingStoreManager(ConnectionStringSettings connectionStringSettings, IEngineFactories factories, IList <ArtefactImportStatus> artefactImportStatuses) { if (connectionStringSettings == null) { throw new ArgumentNullException("connectionStringSettings"); } if (artefactImportStatuses == null) { throw new ArgumentNullException("artefactImportStatuses"); } this._connectionStringSettings = connectionStringSettings; this._artefactImportStatuses = artefactImportStatuses; this._factories = factories ?? new EngineFactories(); Database database = DatabasePool.GetDatabase(connectionStringSettings); this._measureDimensionRepresentationEngine = new MeasureDimensionRepresentationEngine(database); }
/// <summary> /// Create a <see cref="DbTransactionState"/> /// </summary> /// <param name="connectionStringSettings"> /// The connection string settings. /// </param> /// <returns> /// The <see cref="DbTransactionState"/>. /// </returns> public static DbTransactionState Create(ConnectionStringSettings connectionStringSettings) { var database = DatabasePool.GetDatabase(connectionStringSettings); return(Create(database)); }
/// <summary> /// Initializes a new instance of the <see cref="TextFormatTypesQueryEngine"/> class. /// </summary> /// <param name="connectionStringSettings"> /// The connection string settings. /// </param> public TextFormatTypesQueryEngine(ConnectionStringSettings connectionStringSettings) : this(DatabasePool.GetDatabase(connectionStringSettings)) { }