/// <summary> /// Start the asynchronous query request operation. /// </summary> /// <param name="dataSetBase">The base generic data set access layer.</param> /// <param name="callback">The asynchronous call back method.</param> /// <param name="state">The state object value.</param> public AsyncSelectDataTable(ISelectDataSetGenericBase <TDataContext, TDataTable> dataSetBase, AsyncCallback callback, object state) : base(callback, state) { _dataSetBase = dataSetBase; ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncSelectThread3)); Thread.Sleep(20); }
/// <summary> /// Start the asynchronous query request operation. /// </summary> /// <param name="dataSetBase">The base generic data set access layer.</param> /// <param name="callback">The asynchronous call back method.</param> /// <param name="state">The state object value.</param> /// <param name="predicate">The where clause predicate string.</param> public AsyncSelectDataTableRowPredicate(ISelectDataSetGenericBase <TDataContext, TDataTable> dataSetBase, AsyncCallback callback, object state, System.Linq.Expressions.Expression <Nequeo.Threading.FunctionHandler <bool, TDataRow> > predicate) : base(callback, state) { _dataSetBase = dataSetBase; _predicate = predicate; ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncSelectThread1)); Thread.Sleep(20); }
/// <summary> /// Start the asynchronous query request operation. /// </summary> /// <param name="dataSetBase">The base generic data set access layer.</param> /// <param name="callback">The asynchronous call back method.</param> /// <param name="state">The state object value.</param> /// <param name="predicate">The where clause predicate string.</param> /// <param name="values">The values associated with the predicate parameters.</param> public AsyncSelectDataTablePredicate(ISelectDataSetGenericBase <TDataContext, TDataTable> dataSetBase, AsyncCallback callback, object state, string predicate, params object[] values) : base(callback, state) { _dataSetBase = dataSetBase; _values = values; _predicate = predicate; ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncSelectThread1)); Thread.Sleep(20); }
/// <summary> /// Start the asynchronous query request operation. /// </summary> /// <param name="dataSetBase">The base generic data set access layer.</param> /// <param name="callback">The asynchronous call back method.</param> /// <param name="state">The state object value.</param> /// <param name="queryText">The query text to execute.</param> /// <param name="commandType">The command type.</param> /// <param name="values">The collection of sql parameters to include.</param> public AsyncSelectDataTable(ISelectDataSetGenericBase <TDataContext, TDataTable> dataSetBase, AsyncCallback callback, object state, string queryText, CommandType commandType, params DbParameter[] values) : base(callback, state) { _dataSetBase = dataSetBase; _values = values; _queryText = queryText; _commandType = commandType; ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncSelectThread1)); Thread.Sleep(20); }
// Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { // Dispose managed resources. if (this._insertInstance != null) { ((IDisposable)_insertInstance).Dispose(); } if (this._deleteInstance != null) { ((IDisposable)_deleteInstance).Dispose(); } if (this._updateInstance != null) { ((IDisposable)_updateInstance).Dispose(); } if (this._selectInstance != null) { ((IDisposable)_selectInstance).Dispose(); } } // Call the appropriate methods to clean up // unmanaged resources here. this._insertInstance = null; this._deleteInstance = null; this._updateInstance = null; this._selectInstance = null; // Note disposing has been done. disposed = true; } }
/// <summary> /// Default constructor. /// </summary> /// <param name="configurationDatabaseConnection">The connection string or configuration key.</param> /// <param name="insertInstance">The insert instance; can be null if not in use.</param> /// <param name="deleteInstance">The delete instance; can be null if not in use.</param> /// <param name="updateInstance">The update instance; can be null if not in use.</param> /// <param name="selectInstance">The select instance; can be null if not in use.</param> public DataSetTransactions( string configurationDatabaseConnection, IInsertDataSetGenericBase <TDataContext, TDataTable> insertInstance, IDeleteDataSetGenericBase <TDataContext, TDataTable> deleteInstance, IUpdateDataSetGenericBase <TDataContext, TDataTable> updateInstance, ISelectDataSetGenericBase <TDataContext, TDataTable> selectInstance) { // Check to see if the critical parameters // have been set, throw exception on each. if (String.IsNullOrEmpty(configurationDatabaseConnection)) { throw new ArgumentNullException("configurationDatabaseConnection"); } _configurationDatabaseConnection = configurationDatabaseConnection; _insertInstance = insertInstance; _deleteInstance = deleteInstance; _updateInstance = updateInstance; _selectInstance = selectInstance; }
/// <summary> /// Default constructor. /// </summary> /// <param name="configurationDatabaseConnection">The connection string or configuration key.</param> /// <param name="connectionType">The database connection type.</param> /// <param name="connectionDataType">The database connection query type.</param> /// <param name="dataAccessProvider">The data access provider.</param> public DataSetTransactions( string configurationDatabaseConnection, Nequeo.Data.DataType.ConnectionContext.ConnectionType connectionType, Nequeo.Data.DataType.ConnectionContext.ConnectionDataType connectionDataType, IDataAccess dataAccessProvider) { // Check to see if the critical parameters // have been set, throw exception on each. if (String.IsNullOrEmpty(configurationDatabaseConnection)) { throw new ArgumentNullException("configurationDatabaseConnection"); } _configurationDatabaseConnection = configurationDatabaseConnection; // Create an instance of each type. _insertInstance = new InsertDataSetGenericBase <TDataContext, TDataTable> (typeof(TDataTable).Name, connectionType, connectionDataType, dataAccessProvider); _deleteInstance = new DeleteDataSetGenericBase <TDataContext, TDataTable> (typeof(TDataTable).Name, connectionType, connectionDataType, dataAccessProvider); _updateInstance = new UpdateDataSetGenericBase <TDataContext, TDataTable> (typeof(TDataTable).Name, connectionType, connectionDataType, dataAccessProvider); _selectInstance = new SelectDataSetGenericBase <TDataContext, TDataTable> (typeof(TDataTable).Name, connectionType, connectionDataType, dataAccessProvider); }